Skip to content
This repository was archived by the owner on May 15, 2023. It is now read-only.
This repository was archived by the owner on May 15, 2023. It is now read-only.

BUG: Nuxt config not allowing multiple configurations #201

@Soviut

Description

@Soviut

I'm using vue-currency-filter in Nuxt and wanted to have two configurations; The default to show dollars and cents, and another to show just dollars.

However, using the configuration example in the README for multiple configs did not seem to register the filters correctly.

A simplified version of my nuxt.config.js

export default {
  modules: [
    ['vue-currency-filter/nuxt', [
      {
        // default name 'currency'
        symbol: '$',
        thousandsSeparator: ',',
        fractionCount: 2,
        fractionSeparator: '.',
        symbolPosition: 'front',
        symbolSpacing: false,
      },
      {
        name: 'dollars',
        symbol: '$',
        thousandsSeparator: ',',
        fractionCount: 0,
        fractionSeparator: '.',
        symbolPosition: 'front',
        symbolSpacing: false,
      },
    ],
  ],
}
{{ 1000 | currency }}

Yielded a value of 1.000, meaning it was using the default config.

{{ 1000 | dollars }}

Threw an error

[Vue warn]: Failed to resolve filter: dollars

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions