SHARE
TWEET

Untitled

a guest Jun 18th, 2019 54 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. export default myHelper {
  2.     myHelperFunction(param) {
  3.         return param;
  4.     }
  5. }
  6.      
  7. <template>
  8.   <v-text-field :rules="[myRule]"></v-text-field>
  9. </template>
  10.  
  11. <script>
  12. import myHelper from './myHelper.js';
  13.  
  14. export default {
  15.   name: 'MyComponent',
  16.   data() {
  17.     return {
  18.       myCls: new myHelper(),
  19.       myRule: this.callHelperFunction,
  20.     };
  21.   },
  22.   components: {
  23.     myHelper,
  24.   },
  25.   mounted() {
  26.     this.myCls.myHelperFunction();
  27.   },
  28.   methods: {
  29.     callHelperFunction(param) {
  30.       this.myCls.myHelperFunction(param);
  31.     }
  32.   },
  33. };
  34. </script>
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