VUE呈现v-if=true
.但如果我把布尔值改为to false,
一百零二
应该是怎样的呢?有什么方法可以重新渲染吗?
以下是我的代码:
<template>
<div v-if="bool">
true
</div>
<div v-else>
false // if button pressed, i should be shown!!!!
</div>
<button :click='onClickEvent()'>click!!!!!!</button>
</template>
<script>
export default {
data: function () {
return {
bool: true
};
},
created() {
},
mounted(){
}
methods: {
onClickEvent: function(){
this.bool= false
}
}
};
</script>
我试了我能想到的所有方法.