fix: this.route undefined when create Component Page

This commit is contained in:
dntzhang 2020-04-19 07:57:45 +08:00
parent d21160c47a
commit 301c5c99f6
1 changed files with 3 additions and 3 deletions

View File

@ -318,8 +318,8 @@ create.Component = function (store: any | ComponentOption, option?: ComponentOpt
option.ready = option.lifetimes.ready = function (e) {
const store = this.store
store.instances[this.route] = store.instances[this.route] || []
store.instances[this.route].push(this)
store.instances[this.is] = store.instances[this.is] || []
store.instances[this.is].push(this)
this.computed = option.computed
this.setData(option.data)
const using = getUsing(store.data, option.use)
@ -331,7 +331,7 @@ create.Component = function (store: any | ComponentOption, option?: ComponentOpt
}
option.lifetimes.detached = option.detached = function (e) {
this.store.instances[this.route] = this.store.instances[this.route].filter(ins => ins !== this)
this.store.instances[this.is] = this.store.instances[this.is].filter(ins => ins !== this)
detached && detached.call(this, e)
}