3h1-ui 1.0.102 → 1.0.103
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/es/index.js +22 -3
- package/lib/index.js +22 -3
- package/package.json +1 -1
package/es/index.js
CHANGED
|
@@ -2162,13 +2162,32 @@ const _sfc_main$11 = defineComponent({
|
|
|
2162
2162
|
isFirstLoaded.value = true;
|
|
2163
2163
|
emit("options-change", treeData.value);
|
|
2164
2164
|
}
|
|
2165
|
-
|
|
2165
|
+
const filterTreeNode = (input, node) => {
|
|
2166
|
+
if (typeof node.label === "string") {
|
|
2167
|
+
if (node.label.indexOf(input) !== -1) {
|
|
2168
|
+
return true;
|
|
2169
|
+
} else {
|
|
2170
|
+
return false;
|
|
2171
|
+
}
|
|
2172
|
+
} else {
|
|
2173
|
+
if (node.label.indexOf(input) !== -1) {
|
|
2174
|
+
return true;
|
|
2175
|
+
} else {
|
|
2176
|
+
return false;
|
|
2177
|
+
}
|
|
2178
|
+
}
|
|
2179
|
+
};
|
|
2180
|
+
return { getAttrs, loading, handleChange, filterTreeNode };
|
|
2166
2181
|
}
|
|
2167
2182
|
});
|
|
2168
2183
|
function _sfc_render$H(_ctx, _cache, $props, $setup, $data, $options) {
|
|
2169
2184
|
const _component_LoadingOutlined = resolveComponent("LoadingOutlined");
|
|
2170
2185
|
const _component_a_tree_select = resolveComponent("a-tree-select");
|
|
2171
|
-
return openBlock(), createBlock(_component_a_tree_select, mergeProps(_ctx.getAttrs, {
|
|
2186
|
+
return openBlock(), createBlock(_component_a_tree_select, mergeProps(_ctx.getAttrs, {
|
|
2187
|
+
onChange: _ctx.handleChange,
|
|
2188
|
+
"show-search": "",
|
|
2189
|
+
filterTreeNode: _ctx.filterTreeNode
|
|
2190
|
+
}), createSlots({ _: 2 }, [
|
|
2172
2191
|
renderList(Object.keys(_ctx.$slots), (item) => {
|
|
2173
2192
|
return {
|
|
2174
2193
|
name: item,
|
|
@@ -2184,7 +2203,7 @@ function _sfc_render$H(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
2184
2203
|
]),
|
|
2185
2204
|
key: "0"
|
|
2186
2205
|
} : void 0
|
|
2187
|
-
]), 1040, ["onChange"]);
|
|
2206
|
+
]), 1040, ["onChange", "filterTreeNode"]);
|
|
2188
2207
|
}
|
|
2189
2208
|
const ApiTreeSelect = /* @__PURE__ */ _export_sfc(_sfc_main$11, [["render", _sfc_render$H]]);
|
|
2190
2209
|
const _sfc_main$10 = defineComponent({
|
package/lib/index.js
CHANGED
|
@@ -2167,13 +2167,32 @@ const _sfc_main$11 = vue.defineComponent({
|
|
|
2167
2167
|
isFirstLoaded.value = true;
|
|
2168
2168
|
emit("options-change", treeData.value);
|
|
2169
2169
|
}
|
|
2170
|
-
|
|
2170
|
+
const filterTreeNode = (input, node) => {
|
|
2171
|
+
if (typeof node.label === "string") {
|
|
2172
|
+
if (node.label.indexOf(input) !== -1) {
|
|
2173
|
+
return true;
|
|
2174
|
+
} else {
|
|
2175
|
+
return false;
|
|
2176
|
+
}
|
|
2177
|
+
} else {
|
|
2178
|
+
if (node.label.indexOf(input) !== -1) {
|
|
2179
|
+
return true;
|
|
2180
|
+
} else {
|
|
2181
|
+
return false;
|
|
2182
|
+
}
|
|
2183
|
+
}
|
|
2184
|
+
};
|
|
2185
|
+
return { getAttrs, loading, handleChange, filterTreeNode };
|
|
2171
2186
|
}
|
|
2172
2187
|
});
|
|
2173
2188
|
function _sfc_render$H(_ctx, _cache, $props, $setup, $data, $options) {
|
|
2174
2189
|
const _component_LoadingOutlined = vue.resolveComponent("LoadingOutlined");
|
|
2175
2190
|
const _component_a_tree_select = vue.resolveComponent("a-tree-select");
|
|
2176
|
-
return vue.openBlock(), vue.createBlock(_component_a_tree_select, vue.mergeProps(_ctx.getAttrs, {
|
|
2191
|
+
return vue.openBlock(), vue.createBlock(_component_a_tree_select, vue.mergeProps(_ctx.getAttrs, {
|
|
2192
|
+
onChange: _ctx.handleChange,
|
|
2193
|
+
"show-search": "",
|
|
2194
|
+
filterTreeNode: _ctx.filterTreeNode
|
|
2195
|
+
}), vue.createSlots({ _: 2 }, [
|
|
2177
2196
|
vue.renderList(Object.keys(_ctx.$slots), (item) => {
|
|
2178
2197
|
return {
|
|
2179
2198
|
name: item,
|
|
@@ -2189,7 +2208,7 @@ function _sfc_render$H(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
2189
2208
|
]),
|
|
2190
2209
|
key: "0"
|
|
2191
2210
|
} : void 0
|
|
2192
|
-
]), 1040, ["onChange"]);
|
|
2211
|
+
]), 1040, ["onChange", "filterTreeNode"]);
|
|
2193
2212
|
}
|
|
2194
2213
|
const ApiTreeSelect = /* @__PURE__ */ _export_sfc(_sfc_main$11, [["render", _sfc_render$H]]);
|
|
2195
2214
|
const _sfc_main$10 = vue.defineComponent({
|