vue第五课:
if (r.type === 1) {
}
if--》 ===
vue的特殊值标签
v-if
按钮点击事件 @click
<el-button
size="small"
@click="isshow()"
>隐藏</el-button>
v-if 控制显示与隐藏 ==true: 显示 ==false:隐藏
<el-row v-if="show">
<el-col :span="2">
</el-col>
</el-row>
js:show方法调用后,show值相反,即可使层隐藏与显示
<script>
export default {
data() {
return {
show: true,
}
},
created() {
},
methods: {
isshow() {
this.show = !this.show
}
}
}
</script>