Advertisement
Guest User

Untitled

a guest
Oct 20th, 2019
301
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // in mixin.js
  2. export default {
  3.   methods: {
  4.     getName: function () {
  5.        return this.$store.getters['myStore/getName'];
  6.     }
  7.   }
  8. }
  9.  
  10. // im myComponent.vue
  11. <template>
  12.     <h1>{this.getName()}</h1>
  13. <template>
  14. <script>
  15.   import myMixin from './mixin.js
  16.  export default {
  17.    mixins: [myMixin]
  18.  }
  19. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement