ct-component-plus 2.1.10 → 2.1.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
ns.b(),
|
|
6
6
|
ns.is('disabled', disabled),
|
|
7
7
|
ns.is('filterable', filterable),
|
|
8
|
+
componentId,
|
|
8
9
|
]"
|
|
9
10
|
v-model="showValue"
|
|
10
11
|
:props="propsShow"
|
|
@@ -41,6 +42,7 @@ const serviceConfig = inject("$ctServiceConfig");
|
|
|
41
42
|
|
|
42
43
|
const ns = useNamespace("cascader");
|
|
43
44
|
const cascaderRef = ref(null);
|
|
45
|
+
const componentId = `ct-cascader-${Math.random().toString(36).slice(2)}`;
|
|
44
46
|
const checkedText = ref("");
|
|
45
47
|
const propsShow = computed(() => {
|
|
46
48
|
return {
|
|
@@ -73,6 +75,19 @@ watch(showValue, async (newValue) => {
|
|
|
73
75
|
});
|
|
74
76
|
props.cbs.change(dataList, cascaderRef.value);
|
|
75
77
|
}
|
|
78
|
+
if (propsShow.value.multiple && props.filterable) {
|
|
79
|
+
await nextTick();
|
|
80
|
+
|
|
81
|
+
// 如果组件内部没找到,尝试在文档中通过类名查找(作为最后的兜底,注意可能会影响页面上其他同类组件,所以最好通过el限制范围,如果el也拿不到才用document)
|
|
82
|
+
const targetInput = document.querySelector(
|
|
83
|
+
`.${componentId} .el-cascader__search-input`
|
|
84
|
+
);
|
|
85
|
+
|
|
86
|
+
if (targetInput) {
|
|
87
|
+
targetInput.value = "";
|
|
88
|
+
targetInput.dispatchEvent(new Event("input", { bubbles: true }));
|
|
89
|
+
}
|
|
90
|
+
}
|
|
76
91
|
});
|
|
77
92
|
const popperClassShow = computed(() => {
|
|
78
93
|
let popperClass = ns.e("dropdown");
|