✨(component): cascader组件特性更新,新增动态插槽用于自定内容
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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,
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user