Home > Blockchain >  add plugins in vuetify using Vue.use()
add plugins in vuetify using Vue.use()

Time:09-17

I am using vutify with nuxt

I want to add a product zoom plugin in my vuetify application

https://github.com/akulubala/vue-product-zoomer

They showed in order to use the feature you need to add this following.

import ProductZoomer from 'vue-product-zoomer'
Vue.use(ProductZoomer)

where can i find Vue.use in my application file in vuetify

CodePudding user response:

Follow this steps:

  1. Add plugins folder in root directory of your nuxt project.
  2. In this directory, create new file called vue-product-zoomer.js.
  3. Add following codes in this file:
import Vue from "vue"
import ProductZoomer from 'vue-product-zoomer'
Vue.use(ProductZoomer)
  1. In nuxt.config.js file add following line to plugins array:
export default {
  // ...

  plugins: [
      ...
      { src: '~/plugins/vue-product-zoomer.js', mode: 'client' },
  ],

  // ...
}

After doing above steps, you can access this plugins globally through your nuxt app.

  • Related