(component): cascader组件特性更新,新增动态插槽用于自定内容

This commit is contained in:
0o张不歪o0
2022-06-23 17:25:49 +08:00
parent f67a133f94
commit 0eca2df71a
3 changed files with 300 additions and 11 deletions

View File

@@ -42,6 +42,6 @@
background-color: var(--global-checked-color);
color: white;
}
// .layui-cascader.layui-dropdown-up > dl {
// min-width: unset;
// }
.layui-cascader-menu-item .layui-icon-right{
margin-left: 10px;
}

View File

@@ -34,7 +34,11 @@
},
]"
>
{{ item.label }}
<slot
:name="item.slot"
v-if="item.slot && slots[item.slot]"
></slot>
<template v-else>{{ item.label }}</template>
<i
class="layui-icon layui-icon-right"
v-if="item.children && item.children.length"
@@ -153,6 +157,7 @@ function findData(orginData: any, level: number) {
data.push({
value: element.value,
label: element.label,
slot: element.slot || false,
children: element.children ?? false,
});
}