Guest User

Untitled

a guest
Jul 18th, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.89 KB | None | 0 0
  1. // plugin.js
  2.  
  3. import Component from '/src/components/Component.vue'
  4.  
  5. // This exports the plugin object.
  6. export default {
  7.  
  8. // The install method will be called with the Vue constructor as
  9. // the first argument, along with possible options
  10. install (Vue, options) {
  11.  
  12. // Add or modify global methods or properties.
  13. Vue.yourMethod = (value) => value
  14.  
  15. // Add a component or directive to your plugin, so it will be installed globally to your project.
  16. Vue.component('component', Component)
  17.  
  18. // Add `Vue.mixin()` to inject options to all components.
  19. Vue.mixin({
  20.  
  21. // Add component lifecycle hooks or properties.
  22. created() {
  23. console.log('Hello from created hook!')
  24. }
  25. })
  26.  
  27. // Add Vue instance methods by attaching them to Vue.prototype.
  28. Vue.property.$myProperty = 'This is a Vue instance property.'
  29. }
  30. }
Add Comment
Please, Sign In to add comment