Nuxt usage
See original GitHub issueI tried to use this as plugin in Nuxt.
I have created currency.js
under plugins/
folder.
// plugins/currency.js
import VueCurrencyFilter from 'vue-currency-filter'
import Vue from 'vue'
Vue.use(VueCurrencyFilter)
and include the script in nuxt.config.js
// nuxt.config.js
module.exports = {
plugins: [
{ src: '~/plugins/currency.js', ssr: false }
]
}
and inside my component at components/ProductCard.vue
// components/ProductCard.vue
<template>
<h4>{{ price | currency }}</h4>
</template>
<script>
import currency from '~/plugins/currency.js'
export default {
...
}
</script>
This resulted error as below
[Vue warn]: Failed to resolve filter: currency
(found in <ProductCard> at components/ProductCard.vue)
Any workaround how to use this on Nuxt?
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:19 (10 by maintainers)
Top Results From Across the Web
10 reasons to use Nuxt.js for your next web application - Medium
Nuxt.js is a higher-level framework that builds on top of Vue. It simplifies the development of universal or single page Vue apps. Nuxt.js ......
Read more >Nuxt.js over Vue.js: when should you use it and why | Bornfight
Nuxt.js is a frontend framework built upon Vue.js that offers great development features such as server side rendering, automatically generated ...
Read more >When should you Use Nuxt.js instead of Vue.js?
Nuxt.js enables developers to build Server Side Rendered applications in which a Node.js server will deliver HTML to the client based on your ......
Read more >Axios usage - Nuxt
Axios usage. In the first example we show how to use the env property in our nuxt.config.js file to add the URL of...
Read more >Nuxt - The Intuitive Vue Framework
Build your next Vue.js application with confidence using Nuxt. An open source framework making web development simple and powerful.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
my environment Nuxt.js @ v2.14.6 I change
{ src: ‘~/plugins/currency’, ssr: true } <–change to true and everything works
I just updated to
"vue-currency-filter": "^3.2.1"
and still get that error message unfortunately.