1.在编辑框中使用el-radio时候发现无法正常回显,以后怀疑时候第一时间检查自己的代码
<el-radio v-model="editForm.showStatus" label="0">关闭</el-radio>
<el-radio v-model="editForm.showStatus" label="1">开启</el-radio>
this.editForm.showStatus = row.showStatus+'';
this.editForm.operStatus = row.operStatus+'';
字符串类型和数值类型产生了冲突无法正常显示 注意数据格式是否一致
2.控制节点页面无法进行正常刷新
await this.$http.post('/menu/updateMenu',this.editForm)
没有使用await等待这个请求.
async awiait 不足
3.返回控制页面时候想保持原先状态
<keep-alive include="Menu">
<router-view></router-view>
</keep-alive>
include保存需要缓存状态的路由
4.表单数据可以在data里面使用一个对象,这样便于维护
5.scoped样式不生效
使用 最外层元素选择器>>>想要生效的元素
6.对el-table表格中的插槽进行过滤
<el-table-column
prop="status"
label="文字类型"
:filter-method="filterTag"
:filters="filterFileType"
width="width">
<template slot-scope="scope">
<!-- {{scope.row.status}} -->
<span v-if="scope.row.status === 0"> 历史 </span>
<span v-else-if="scope.row.status === 1"> 现在 </span>
</template>
</el-table-column>
//表格类型过滤
filterFileType: [
{ text: "过去", value: 0 },
{ text: "现在", value:1 },
],
// template表格过滤 注意“1” 1 区别
filterTag(value, row,column) {
const property = column['property'];
return row[property] === value;
},