adding a prototype on vue using nuxt
snippet in javascript

adding a prototype on vue using nuxt

user2800

// 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']
}