[Vuejs]-Vuejs Filter add Span

0👍

I declared you value in the data() function like so :

data () {
    return {
        number: '1500,00',
        newNumber: [],
    }
},

What I did to make this work is make a created function like so :

created() {
    this.newNumber = this.number.split(',')
},

Then, in the frontend (your p and span) :

<p>{{ newNumber[0] }}<span>,{{newNumber[1]}}</span></p>

What I did is turn a value into an array by using the split() function.

There is probably a way better solution but this is what I came up with in a short amount of time, I hope it helps.

Leave a comment