behavior.js 391 B

1234567891011121314
  1. export const behavior = Behavior({
  2. methods: {
  3. set(data, callback) {
  4. return new Promise(resolve => {
  5. this.setData(data, () => {
  6. if (callback && typeof callback === 'function') {
  7. callback.call(this);
  8. }
  9. resolve();
  10. });
  11. });
  12. }
  13. }
  14. });