1

For SEO Reasons i had to rebuild my vuejs app with Nuxt.

How can you import npm packages in nuxt app?

like in vue.js you simply add the code below to APP.vue

import InfiniteLoading from 'vue-infinite-loading'
vue.use(InfiniteLoading)
1
  • 1
    make a plugin and include it in the nuxt.config.js Commented Jan 22, 2020 at 7:38

1 Answer 1

1

create new file in plugin folder infinite-loading.js

import vue from "vue"
import InfiniteLoading from 'vue-infinite-loading'
vue.use(InfiniteLoading)

in nuxt.config.js include your file name in plugin array

  plugins: [
    '@/plugins/infinite-loading',
  ],

then restart the serve

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

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.