Vue Currency Filter is a lightweight library designed for formatting currency values within Vue 2 applications. It provides a flexible filter based on the principles of `accounting.js`, allowing developers to easily display monetary amounts with configurable symbols, separators, and decimal precision. The current stable version is 5.2.0. A key differentiator is its simplicity for Vue 2 projects needing quick currency formatting without complex component structures. However, it is critical to note that the project's GitHub repository was archived in May 2023, indicating that the library is no longer actively maintained. It is strictly for Vue 2, as Vue 3 removed the concept of filters.
npm install vue-currency-filterVerified import paths — ran on the pinned version, not inferred.
Demonstrates global registration of the currency filter with custom options and its usage in a Vue 2 template.
Evaluate alternative, actively maintained Vue 2 currency formatting libraries, or consider migrating to Vue 3 and implementing custom computed properties or methods for currency formatting.
For Vue 3, implement currency formatting using computed properties, methods, or a dedicated Vue 3-compatible component library.
Review the official GitHub repository's commit history around the 5.0.0 release for specific changes if encountering unexpected behavior. Thoroughly test existing currency filter usages after upgrading.
Ensure correct TypeScript type imports are used if migrating a JavaScript project, or if encountering type-related issues. Verify compatibility of existing configurations.
Upgrade to `vue-currency-filter` version 5.1.1 or higher to resolve known Nuxt.js compatibility issues. Review Nuxt-specific configuration examples provided by the library or community if issues persist.
Ensure you are using Vue 2 and that `Vue.use(VueCurrencyFilter, ...)` is called before the Vue instance is created. For Vue 3, filters are deprecated and this library will not work; use computed properties or methods instead.
In your `shims-vue.d.ts` or similar declaration file, add type augmentation for `Vue` to include the `$options.filters` property, for example: `declare module 'vue/types/vue' { interface Vue { currency: (value: number, symbol?: string, fractionCount?: number) => string; } }`Ensure `vue-currency-filter` is installed and configured correctly within your `nuxt.config.js` plugins array (e.g., `plugins: ['~/plugins/vue-currency-filter']`). If using an older version, upgrade to 5.1.1 or later. Ensure the plugin is loaded client-side if it relies on browser-specific globals.
No dependency data recorded yet.