One button in vue controls the display and hiding

single button controls display and hides

<template>
    <div>
        <div v-if="isshow">{{isshow}}</div>
        <button @click="change()"></button>
    </div>
</template>
<script>
    export default({
        name:"",
        data(){
            return{
                isshow:false,
                }
            },
        methods:{
            change:function(){
                this.isshow=!this.isshow
                }
        })
</script>

the above code can achieve a single control to show and hide, but I want to write this.isshowroomroomthis.isshow on the tag. How should I write it?

Jul.13,2022

<template>
    <div>
        <div v-if="isshow">{{isshow}}</div>
        <button @click="isshow = !isshow"></button>
    </div>
</template>

if it helps you, please upvote or adopt


< button @ click= "isshow =! isshow" > Click < / button >

Menu