SHARE
TWEET

membuat-promise-based-dialog#04

meshwara Aug 25th, 2019 89 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. methods: {
  2.     open() {
  3.       return new Promise((resolve, reject) => {
  4.         this.resolve = resolve;
  5.         this.reject = reject;
  6.  
  7.         this.dialog = true;
  8.       });
  9.     },
  10.     accept(str) {
  11.       this.dialog = false;
  12.       this.resolve(str);
  13.     },
  14.     cancel(str) {
  15.       this.dialog = false;
  16.       this.reject(str);
  17.     }
  18. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top