Answer the question
In order to leave comments, you need to log in
How to return a value?
there is such a code
<td v-for="md in monday" @mousemove="mouseoverEvent($event, md.status )" :class="{red: md.status}" :key="md.id" :data-hours="md.minutes"> </td>
methods:{
mouseoverEvent:function(event, status){
if(event.which == 1){
return status=!status
}
}
},
@mousemove="md.status=!md.status"
Answer the question
In order to leave comments, you need to log in
Man, learn the basics.
Nothing is passed by reference to js, a copy of the reference is made for objects, primitives are copied completely. status
inside mouseoverEvent
you have a completely separate variable and a new primitive. Need to be transferred md
.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question