The following cannot be implemented to display and hide v-show blocks

<ul>
    <li v-show="isDisplay[0]">
        0
    </li>
<ul>
<button @click="change">change</button>
Copy the code
// vue data
data() {
    return {
        isDisplay: [true].}}// vue methods
methods: {
    change() {
        return !this.isDisplay[0]; }}Copy the code

But if the elements in the array are objects, we can do this:

<ul>
    <li v-show="isDisplay[0].value">
        0
    </li>
<ul>
<button @click="change">change</button>
Copy the code
// vue data
data() {
    return {
        isDisplay: [{value: true}].}}// vue methods
methods: {
    change() {
        return !this.isDisplay[0].value; }}Copy the code