render增加容错处理
parent
87496a1487
commit
2aa9ab5af0
|
@ -376,11 +376,15 @@ export class Component extends HTMLElement {
|
|||
|
||||
// 渲染视图
|
||||
#render() {
|
||||
try {
|
||||
let ast = this.render()
|
||||
this[__children__] = render(ast, this.root, {
|
||||
host: this,
|
||||
isConnected: !this[__mounted__] && this.isConnected
|
||||
})
|
||||
} catch (err) {
|
||||
console.error(err)
|
||||
}
|
||||
}
|
||||
// 几个生命周期回调
|
||||
created() {}
|
||||
|
|
Loading…
Reference in New Issue