After vue, changes the Boolean value of the v-if binding, dom is not updated immediately. Why, what is the solution?

A group of pictures that can be dragged with the mouse to change the value of left ((mousedown mousemove mouseup,)

double-click one of the pictures to change the Boolean value of its corresponding v-if (to delete the picture), but the view is not updated immediately , but is updated (deleted) as you continue to drag the set of pictures.

should be related to the response principle of vue, but because of beginners, I don"t quite understand it, so ask for guidance?

Jun.21,2021

you can watch monitor the value judged in your v-if, and display this value in the view to see if there are any updates. If it is a separate Boolean control in data. It should be updated immediately.


finally solved! The reason is that vue cannot monitor the addition or deletion of object attributes and needs to be deleted through Vue.delete.


when I encounter a situation similar to yours, you can take a look at this due to JavaScript restrictions, Vue cannot detect the following changing arrays

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-1b41490-2c597.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-1b41490-2c597.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?