先看运行结果:
初始是默认为显示全部信息:
点击隐藏,结果如下图:
完整代码如下:(表格数据:https://www.easy-mock.com/mock/5ce57090f2fc446b5d8ffe18/blog/blogdata)
< template>
< div class=“show-examples”>
< el-switch v-model=“value1” active-value=“false” inactive-value=“true” active-text=“隐藏” inactive-text=“显示” style=“height:50px” @change=“change”>
< /el-switch>
< el-table :data=“blogData” style="width: 100% ">
< el-table-column prop=“id” label="#" width=“180”>
< /el-table-column>
< el-table-column prop=“name” label=