admin管理员组文章数量:1332705
I'm new in nuxt js so when I try to add npm packages it won't work these are trials.
star-raing.js
import Vue from 'vue'
import StarsRatings from 'vue-star-rating'
Vue.use(StarsRatings)
nuxt.config.js
plugins: [{ src: '~/plugins/star-rating.js', mode: 'client' }],
build: {
/*
** You can extend webpack config here
*/
extend(config, ctx) {},
transpile: ['star-rating']
}
it shows these errors
[Vue warn]: The client-side rendered virtual DOM tree is not matching server-rendered content. This
is likely caused by incorrect HTML markup, for example nesting block-level elements inside <p>, or
missing <tbody>. Bailing hydration and performing full client-side render.
[Vue warn]: Unknown custom element: <stars-ratings> - did you register the ponent correctly? For
recursive ponents, make sure to provide the "name" option.
found in
---> <Deals> at ponents/Home/Deals.vue
<Home> at pages/index.vue
<Nuxt>
<Default> at layouts/default.vue
<Root>
I'm new in nuxt js so when I try to add npm packages it won't work these are trials.
star-raing.js
import Vue from 'vue'
import StarsRatings from 'vue-star-rating'
Vue.use(StarsRatings)
nuxt.config.js
plugins: [{ src: '~/plugins/star-rating.js', mode: 'client' }],
build: {
/*
** You can extend webpack config here
*/
extend(config, ctx) {},
transpile: ['star-rating']
}
it shows these errors
[Vue warn]: The client-side rendered virtual DOM tree is not matching server-rendered content. This
is likely caused by incorrect HTML markup, for example nesting block-level elements inside <p>, or
missing <tbody>. Bailing hydration and performing full client-side render.
[Vue warn]: Unknown custom element: <stars-ratings> - did you register the ponent correctly? For
recursive ponents, make sure to provide the "name" option.
found in
---> <Deals> at ponents/Home/Deals.vue
<Home> at pages/index.vue
<Nuxt>
<Default> at layouts/default.vue
<Root>
Share
Improve this question
edited Mar 18, 2020 at 11:05
moshfiqrony
4,7433 gold badges23 silver badges32 bronze badges
asked Mar 18, 2020 at 8:39
Mohamed ZhranMohamed Zhran
234 bronze badges
3
- could you show us your home/deals.vue? – Ilijanovic Commented Mar 18, 2020 at 9:00
- stars-ratings ponent is not registered. ponents: { 'star-rating', VueStarRating.default } – Vigikaran Commented Mar 18, 2020 at 15:50
-
Thanks for help
本文标签: javascriptcan39t add npm package to nuxt js vuestarratingStack Overflow
版权声明:本文标题:javascript - can't add npm package to nuxt js [vue-star-rating] - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742340967a2456593.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论