el-table
Q:有fixed屬性時,無數據時,可能出現底部邊框消失的bug
現象:
解決方法:
.el-table__empty-block {border-bottom: 1px solid var(--el-table-border-color);
}
el-collapse?折疊面板
Q:標題上有按鈕,內容中有dialog。按鈕控制dialog的打開和關閉。面板折疊時,dialog不能正常彈出。
<el-collapse v-model="activeNames"><el-collapse-item title="title" name="1"><template #title>title <el-button type="text" @click.stop="dialogVisible = true">新增</el-button></template><el-dialogtitle="title"v-model="dialogVisible"width="80%":before-close="() => {dialogVisible = false;}"></el-dialog></el-collapse-item>
</el-collapse>const activeNames = ["1"];
const dialogVisible = ref(false);
分析:面板折疊時,.el-collapse-item?.el-collapse-item__wrap 的行內樣式為?display: none;。el-dialog作為其后代元素,被隱藏了。
解決方案:el-dialog 不作為el-collapse-item的后代元素就可以。
A1:el-dialog 加?append-to-body 屬性。
<el-dialog append-to-body></el-dialog>
A2:el-dialog 不嵌套在 el-collapse-item 內部即可。可以并列。
<el-collapse v-model="activeNames"><el-collapse-item title="title" name="1"></el-collapse-item><el-dialog></el-dialog>
</el-collapse>
?
國際化
Q:[plugin:vite:import-analysis] No known conditions for "./lib/locale/lang/zh-cn" specifier in "element-plus" package
場景:為了使用錨點(2.6.0)功能,升級了element-plus版本(2.3.6 -> 2.6.1),報錯。
解決方案:修改中文的引入路徑。
原:import zhCn from 'element-plus/lib/locale/lang/zh-cn'
修改為:
import zhCn from 'element-plus/es/locale/lang/zh-cn'
The End.