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