krustnic / v-inputmask

Input mask directive for Vue 2.* based on jquery.inputmask
9 stars 0 forks source link

Doesn't work with NUXT.js #4

Open dzarezenko opened 5 years ago

dzarezenko commented 5 years ago

When I am trying to use this package in my NUXT.js project I receiving window is not defined error

screen shot 2019-02-15 at 16 30 17

cbgesbocker commented 5 years ago

Try to add the dependency inside the nuxt config file and then just call new Inputmask inside mounted call. Just had the same issue.

EDIT Use this https://github.com/vuejs-tips/v-money

AntonLatyshev commented 4 years ago

In the plugins folder, create the vuemask.client.js file Add to it: import Vue from 'vue' const VueInputMask = require ('vue-inputmask'). default Vue.use (VueInputMask) Include this file in nuxt.config.js Last step in tag input: v-mask = "{mask: '+38 (999) 999-99-99'}"