Invalid v-if in vue

clipboard.png

The array of

loops has depshow to control each dep-list to show and hide

The

method changes the depshow false true of each element in the array, but this component still does not display

want to put a layer of div package on the outside, but also do not display

Mar.22,2021

you have to write here (data.depshow = = true). You cannot directly write depshow. As long as there is content, it is right. What is identified here is the expression


. I also encountered it. I don't know how to solve the problem. The value passed by


data.depshow is of string type, so it does not take effect. This problem will not occur if the Boolean type is passed.
solution 1: change the passed value to a Boolean type, that is, the passed value true or false, and remove the quotation marks

. Solution 2: change the passed value to a Boolean type, that is, the passed value true or false, and remove the quotation marks

.
Menu