单个按钮控制显示隐藏
<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>
上面代码可以实现单个控制显示隐藏,但是我想把this.isshow=!this.isshow写在标签上该怎么写?
如果有帮到你请 upvote 或采纳