vuejs-tips / vue-the-mask

Tiny (<2k gzipped) and dependency free mask input for Vue.js
https://vuejs-tips.github.io/vue-the-mask/
1.74k stars 213 forks source link

Import mask directive using Nuxt #122

Closed fabio-rsys closed 4 years ago

fabio-rsys commented 5 years ago

Hello guys, I've used this plugin locally on a page and it worked just fine.

Now I'm trying to import the mask directive globally on my project, I use Nuxt.

Have someone done this and could shed some light?

brsalviano commented 5 years ago

You can create a plugin inside plugins folder. For exemple:

import Vue from 'vue'
import VueTheMask from 'vue-the-mask'
Vue.use(VueTheMask)

After, in nuxt.config.js you need to register the plugin:

  plugins: [
    '~plugins/vue-the-mask.js'
  ]

That's it. It worked for me.

vhoyer commented 5 years ago

did this got resolved? it would be cool to know to close the issue :sweat_smile:

fabio-rsys commented 4 years ago

Yes it worked just fine, forgot to reply, sorry!