Handle shared attributes object in hyperscript (#1941)
This commit is contained in:
parent
b38367aa30
commit
0986140ed5
3 changed files with 30 additions and 0 deletions
|
|
@ -28,6 +28,18 @@ function execSelector(state, attrs, children) {
|
|||
var hasAttrs = false, childList, text
|
||||
var className = attrs.className || attrs.class
|
||||
|
||||
if (Object.keys(state.attrs).length && Object.keys(attrs).length) {
|
||||
var newAttrs = {}
|
||||
|
||||
for(var key in attrs) {
|
||||
if (hasOwn.call(attrs, key)) {
|
||||
newAttrs[key] = attrs[key]
|
||||
}
|
||||
}
|
||||
|
||||
attrs = newAttrs
|
||||
}
|
||||
|
||||
for (var key in state.attrs) {
|
||||
if (hasOwn.call(state.attrs, key)) {
|
||||
attrs[key] = state.attrs[key]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue