<template>
<div class="app-container">
<div class="drawer-item">
<el-switch v-model="switchView" active-text="显示" inactive-text="隐藏" @change="switchChange($event)" /><br><br>
<div v-show="isShow" style="width:200px; height:200px; background-color:#FF0000;">123</div>
</div>
</div>
</template>
<script>
export default {
data() {
return {
switchView:false,
isShow: false,
}
},
methods: {
switchChange: function(val) {
this.isShow = val
}
}
}
</script>
*
*
*