v-show 就是动态设置 display
:class="[show_side?'show':'hide']"
<el-aside width="200px" style="overflow: hidden; border-right: 1px #efefef solid;" :class="[show_side?'show':'hide']" >
</el-aside>
.show{}
.hide{
display: none;
}
这样只是样式上的隐藏和显示,如果用v-if 则会销毁和创建 el-aside
比如这样不可取:
<el-aside v-if="show_side" width="200px" style="overflow: hidden; border-right: 1px #efefef solid;" >
</el-aside>