准备 AI重建
This commit is contained in:
1 parent
c36f2d60c2
commit
3429c8b402
1487 files changed
+5307
-3208
No files matched your search
+26
@@ -0,0 +1,26 @@
|
||||
export const basic = Behavior({
|
||||
methods: {
|
||||
$emit(name, detail, options) {
|
||||
this.triggerEvent(name, detail, options);
|
||||
},
|
||||
set(data) {
|
||||
this.setData(data);
|
||||
return new Promise((resolve) => wx.nextTick(resolve));
|
||||
},
|
||||
// high performance setData
|
||||
setView(data, callback) {
|
||||
const target = {};
|
||||
let hasChange = false;
|
||||
Object.keys(data).forEach((key) => {
|
||||
if (data[key] !== this.data[key]) {
|
||||
target[key] = data[key];
|
||||
hasChange = true;
|
||||
}
|
||||
});
|
||||
if (hasChange) {
|
||||
return this.setData(target, callback);
|
||||
}
|
||||
return callback && callback();
|
||||
},
|
||||
},
|
||||
});
|
||||
Reference in new issue
Block a user