This repository has been archived on 2023-08-30. You can view files and clone it, but cannot push or open issues/pull-requests.
bytedo
/
wcui
Archived
1
0
Fork 0

优化layer组件的回调;优化store模块的索引

old
宇天 2018-07-02 20:10:58 +08:00
parent 29a42aa21e
commit d689025bb7
2 changed files with 6 additions and 2 deletions

View File

@ -170,7 +170,11 @@ class __layer__ {
} }
} }
if (typeof this.props.yes === 'function') { 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 { } else {
this.close() this.close()
} }

View File

@ -185,7 +185,7 @@ class AnotStore {
__INSERT__(item, primary) { __INSERT__(item, primary) {
let collection = __STORE__[this.__name__] let collection = __STORE__[this.__name__]
let collectionDict = __STORE__[`${this.__name__}Dict`] let collectionDict = __STORE__[`${this.__name__}Dict`]
let _id = item[primary || `${this.__name__}_id`] let _id = item[primary || 'id']
let tmp = collectionDict[_id] let tmp = collectionDict[_id]
// 已存在, 则直接更新 // 已存在, 则直接更新
if (tmp) { if (tmp) {