omi - fix remove attr

This commit is contained in:
dntzhang 2019-05-08 07:25:03 +08:00
parent 9464034403
commit ee400d1f29
3 changed files with 1862 additions and 1 deletions

View File

@ -24,3 +24,14 @@ export function proxyUpdate(ele) {
}
})
}
export function proxyProps(ele) {
ele.props = new JSONProxy(ele.props).observe(false, (patch) => {
if(patch.path!== '/children'){
ele.pureSetAttribute(patch.path.replace('/',''), patch.value)
if (!ele._willUpdate) {
ele.update()
}
}
})
}

View File

@ -167,7 +167,9 @@ export default class WeElement extends HTMLElement {
ele.props[key] = JSON.parse(val.replace(/(['"])?([a-zA-Z0-9_]+)(['"])?:([^\/])/g, '"$2":$4').replace(/'([\s\S]*?)'/g, '"$1"'))
break
}
}
} else {
ele.props[key] = null
}
})
}

File diff suppressed because it is too large Load Diff