How does vue modify the data in data to render values?

it"s easy to understand metaphorically.

data(){
    return {
        province:""
        }
    },

I want to modify the above province

here.
<div v-for="item in area" @click="province = {{ item.name }}">{{ item.name }}</div>

there is no reaction in writing like this.

This is probably what

means. Is it written in the wrong way? Or not at all? Solve the problem

Jun.18,2021

is not written correctly

<div v-for='item in area' @click='province = item.name '>{{ item.name }}</div>

<div v-for='item in area' @click='e => province = item.name'>{{ item.name }}</div>

the parenthesis syntax in the vue template is used to interpolate in the template, not in JS code


is the wrong way to write it. You can write
< div VMI for = "item in area" @ click=' () = > province = item.name': key= "item.name" > {{item.name}} < / div >

you can also define functions in js to make calls

clipboard.png


obviously, I made a mistake, and there was a grammatical problem

.

:{{province}}

<div v-for='item in area' @click='province = item.name'>{{ item.name }}</div>

even if it is correct, you can't see the change, because the current one is to add a display to the item.name, which is more obvious

.
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e639d6-45a3b.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e639d6-45a3b.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?