Vue.js data values ​​remain unchanged
P粉274161593
P粉274161593 2024-04-03 09:29:23
0
1
369

I have a data called: cat_pressed

There is also this function that changes the data value:

changeCat(){
            this.cat_pressed === 'brauh'
}

But whenever I call the function the value doesn't change, I don't know why I've tried everything but nothing works.

P粉274161593
P粉274161593

reply all(1)
P粉523335026

It looks like you accidentally used the wrong operator.

Use

=== for checking equality - but you want the value to be assigned to cat_pressed, so you need =.

changeCat(){
    this.cat_pressed = 'brauh'
}
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!