deguodaigou/utils/dist/mixins/observer/behavior.js

15 lines
391 B
JavaScript
Raw Normal View History

2019-12-14 09:20:48 +08:00
export const behavior = Behavior({
methods: {
set(data, callback) {
return new Promise(resolve => {
this.setData(data, () => {
if (callback && typeof callback === 'function') {
callback.call(this);
}
resolve();
});
});
}
}
});