1、el-tree單選需要判斷是否可點,并展示禁用樣式,element plus中要想直接使用禁用樣式需要搭配復選框進行顯示的,但是我們業(yè)務需求是單選,
const defaultProps = {
children: 'children',
label: 'name',
disabled: 'disabled',
class:customNodeClass,
}
const customNodeClass = data => {
if (data.disabled) {
return 'is-penultimate'
}
return null
}
:deep(.is-penultimate > .el-tree-node__content) {
color: #ccc;
cursor: not-allowed !important;
}
圖示:

image.png
2.form表單不校驗的問題
const changePwdForm = reactive({
oldPassword: null,
pass: null,
checkPass: null,
}) //初始化數據如果填寫為null的話form表單不校驗
//正確應該如下
const changePwdForm = reactive({
oldPassword: '',
pass: '',
checkPass: '',
})
3.table復選框回顯不生效問題
加載數據之前先this.$refs.multipleTable.clearSelection();
之后匹配要會顯得數據
toggleSelection(rows) {
if (rows) {
rows.forEach(row => {
this.$refs.multipleTable.toggleRowSelection(this.table.tableData.find(item => { return row.id == item.id; }),true);
});
} else {
this.$refs.multipleTable.clearSelection();
}
},
4.el-popver 彈出框收線問題解決 增加popper-options

image.png
<el-popover placement="right" :width="900" trigger="click" :popper-options="{ modifiers: [{ enabled: true }], strategy: 'fixed', placement: 'auto' }">
<template #reference>
<el-button style="margin-right: 16px">Click to activate</el-button>
</template>
<ul>
<li v-for="i in 10" :key="i">{{ i }}</li>
</ul>
</el-popover>
5.# [el-table,type='expand'展開行,@expand-change=" "事件動態(tài)數據刷新問題]