greenPro/wxcomponents/vant/mixins/observer/behavior.js

15 lines
391 B
JavaScript
Raw Permalink Normal View History

2024-06-02 14:51:29 +00: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();
});
});
}
}
});