🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

ct-component-plus

Package Overview
Dependencies
Maintainers
6
Versions
102
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ct-component-plus - npm Package Compare versions

Comparing version
2.2.13
to
2.2.14
+1
-1
package.json
{
"name": "ct-component-plus",
"private": false,
"version": "2.2.13",
"version": "2.2.14",
"type": "module",

@@ -6,0 +6,0 @@ "main": "packages/components/index.js",

<template>
<el-cascader ref="cascaderRef" :class="[
ns.b(),
ns.is('disabled', disabled),
ns.is('filterable', filterable),
componentId,
]" v-model="showValue" :props="propsShow" :options="optionsShow" :show-all-levels="showAllLevels"
:filterable="filterable" :clearable="clearable" :disabled="disabled" :popper-class="popperClassShow"
v-bind="{ ...$attrs, ...rawAttr }" />
<el-cascader
ref="cascaderRef"
:class="[
ns.b(),
ns.is('disabled', disabled),
ns.is('filterable', filterable),
componentId,
]"
v-model="showValue"
:props="propsShow"
:options="optionsShow"
:show-all-levels="showAllLevels"
:filterable="filterable"
:clearable="clearable"
:disabled="disabled"
:popper-class="popperClassShow"
v-bind="{ ...$attrs, ...rawAttr }"
/>
<!-- <Teleport :to="appendPanelDom">

@@ -94,3 +104,3 @@ <span>大写的六</span>

getCheckedText();
}
},
);

@@ -157,3 +167,3 @@ const appendPanelDom = document.createElement("div");

});
} catch (error) { }
} catch (error) {}
}

@@ -164,3 +174,3 @@ if (isFunction(cbs.defineSearch)) {

optionsByApi,
showValue
showValue,
);

@@ -171,18 +181,22 @@ if (defineSearchHandle === false) return;

}
} catch (error) { }
} catch (error) {}
}
});
function findLabelsByValues(tree, values) {
// 通过value值的数组获取label并返回一个包含label的数组
const result = [];
const valueKey = props.mapObj?.value || "value";
const labelKey = props.mapObj?.label || "label";
const childrenKey = props.mapObj?.children || "children";
function traverse(node) {
if (!values && values.includes(node[props.mapObj?.value || "value"])) {
result.push(node[props.mapObj?.label || "label"]);
if (isArray(values) && values.includes(node?.[valueKey])) {
result.push(node?.[labelKey]);
}
if (node.children && node.children.length > 0) {
node.children.forEach(traverse);
const children = node?.[childrenKey];
if (isArray(children) && children.length > 0) {
children.forEach(traverse);
}
}
if (!isArray(tree)) return result;
tree.forEach(traverse);

@@ -195,4 +209,5 @@ return result;

optionsShow.value,
props.multiple ? showValue.value : [showValue.value]
props.multiple ? showValue.value : [showValue.value],
);
console.log(data, "data", showValue.value);
if (props.multiple) {

@@ -199,0 +214,0 @@ return data;