优化layer组件的回调;优化store模块的索引
parent
29a42aa21e
commit
d689025bb7
|
@ -170,7 +170,11 @@ class __layer__ {
|
|||
}
|
||||
}
|
||||
if (typeof this.props.yes === 'function') {
|
||||
this.props.yes.call(this, this.prompt, this.$id)
|
||||
let cb = [this.$id]
|
||||
if (this.type === 3) {
|
||||
cb.unshift(this.prompt)
|
||||
}
|
||||
this.props.yes.apply(this, cb)
|
||||
} else {
|
||||
this.close()
|
||||
}
|
||||
|
|
|
@ -185,7 +185,7 @@ class AnotStore {
|
|||
__INSERT__(item, primary) {
|
||||
let collection = __STORE__[this.__name__]
|
||||
let collectionDict = __STORE__[`${this.__name__}Dict`]
|
||||
let _id = item[primary || `${this.__name__}_id`]
|
||||
let _id = item[primary || 'id']
|
||||
let tmp = collectionDict[_id]
|
||||
// 已存在, 则直接更新
|
||||
if (tmp) {
|
||||
|
|
Reference in New Issue