0

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

0

1 Answer 1

1

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.

Sign up to request clarification or add additional context in comments.

3 Comments

I used your solution, it shows 500 internal server error when I am loading the app.
prepend -client to the end of the filename, vue-product-zoomer-client.js
Try this { src: '~/plugins/vue-product-zoomer.js', mode: 'client' } instead of "~/plugins/vue-product-zoomer.js" in plugins array.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.