mirror of
https://github.com/primefaces/primevue.git
synced 2025-05-10 17:32:36 +00:00
Fixed #1263 - Kebap-case is not supported in some components like DataTable
This commit is contained in:
parent
231dfe22c1
commit
fe9413c7b7
9 changed files with 43 additions and 17 deletions
|
@ -191,4 +191,17 @@ export default class ObjectUtils {
|
|||
|
||||
return str;
|
||||
}
|
||||
|
||||
static getVNodeProp(vnode, prop) {
|
||||
let props = vnode.props;
|
||||
if (props) {
|
||||
let kebapProp = prop.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase();
|
||||
let propName = Object.prototype.hasOwnProperty.call(props, kebapProp) ? kebapProp : prop;
|
||||
|
||||
return ((vnode.type.props[prop].type === Boolean && props[propName] === '') ? true : props[propName]);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue