D
D
danilr2020-02-19 20:42:50
Vue.js
danilr, 2020-02-19 20:42:50

Why is the computed property throwing an error?

computed: {
    replaceDotOnComma(value) {
      if (!value) return '';
      return (''+ value).replace('.',',');
    }

I wanted to make a simple property that returns a value by slightly changing the input value ( 33.4 => '33,4' ).
Why does it say that replaceDotOnComma is not a function and how do I do that?
The computer property can take an input parameter. I don't seem to need a setter, because I don't write anything anywhere.
5e4d73912dc72078499586.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alex, 2020-02-19
@danilr

replaceDotOnComma is not a function. And cannot be called as a function

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question