B
B
BonBon Slick2020-09-04 21:10:06
Vue.js
BonBon Slick, 2020-09-04 21:10:06

How to change local variable in vue for?

<td class="text-center  no-wrap pa-2">
                        {{ localVar + 1234 }} // Value added always to 0, output always = 1234
// or
                        {{ localVar += 1234 }} // ERROR! infinite loop
                    </td>


data:       () => (
            {
                localVar: 0,

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Aetae, 2020-09-04
@BonBonSlick

No way. There should be no data changes in the View layer. Fundamentally.
Read about MVVM .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question