Example of Code
<div v-for="item in dataItems">
<div v-if="enableEdit">
<input type="text" v-model="name">
</div>
<div v-else>
{{name}}
</div>
<button @click="enableEdit = true">click</button>
This code snippet is currently not functioning properly due to the fact that enableEdit
is not declared as a variable inside the script.
Is it feasible to create a local variable within v-for?