Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

adding a prototype on vue using nuxt

// create in plugins/hello
export default ({ app }, inject) => {
  // Inject $hello(msg) in Vue, context and store.
  inject('hello', msg => console.log(`Hello ${msg}!`))
}

// add in nuxt.config.js
export default {
  plugins: ['~/plugins/hello.js']
}
Source by nuxtjs.org #
 
PREVIOUS NEXT
Tagged: #adding #prototype #vue #nuxt
ADD COMMENT
Topic
Name
2+9 =