單個(gè)按鈕控制顯示隱藏<template>
<div>
<div v-if="isshow">{{isshow}}</div>
<button @click="change()">點(diǎn)擊</button>
</div></template><script>
export default({ name:'',
data(){ return{ isshow:false,
}
}, methods:{ change:function(){ this.isshow=!this.isshow
}
})</script>上面代碼可以實(shí)現(xiàn)單個(gè)控制顯示隱藏,但是我想把this.isshow=!this.isshow寫在標(biāo)簽上該怎么寫?
vue一個(gè)按鈕控制顯示隱藏
慕運(yùn)維8079593
2019-03-10 22:21:30