D
D
dicem2021-06-03 14:38:35
typescript
dicem, 2021-06-03 14:38:35

This is expression is not callable when adding a module to Nuxt, why?

Added a project to nuxt, module moment-module , installed according to the manual in readme.md
However, when used in a component ::::

...
    computed: {
      currentMonth (): string {
        return this.$moment(this.viewableDate).format('mmmm')
      },

      daysInMonth (): number {
        return this.$moment(this.viewableDate).daysInMonth()
      }
    }
...


I am getting an error in this.$moment(...) expression
This expression is not callable.
  Not all constituents of type '(() => any) | ComputedOptions<any>' are callable.
    Type 'ComputedOptions<any>' has no call signatures.Vetur(2349)

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question