div{{isVisible}}!--responsiveness works, isVisible switches from false to true--!
composition-api and nuxt3 - I can't achieve responsiveness
P粉014293738
P粉014293738 2023-09-09 08:45:14
0
1
401

I have a working Nuxt code:

 

I tried using composition-api to convert, but it's not possible: it doesn't work.

I don't have an error message, but I feel unresponsive.

However, console.log will change the value (but the value in the template will not change)

 

P粉014293738
P粉014293738

reply all (1)
P粉143640496

You need to change the following lines

isVisible = !isVisible;

change to

isVisible.value = !isVisible.value

For more information, please refer to:https://vuejs.org/guide/essentials/reactivity-fundamentals.html#ref

    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!