vue2-client 1.8.178 → 1.8.179
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
|
@@ -111,7 +111,7 @@ const debouncedSearch = debounce((value) => {
|
|
|
111
111
|
console.log('Search:', value)
|
|
112
112
|
// 在这里执行你的搜索逻辑
|
|
113
113
|
if (value) {
|
|
114
|
-
filteredTreeData.value = searchInTree(_treeData, value)
|
|
114
|
+
filteredTreeData.value = searchInTree(_treeData.value, value)
|
|
115
115
|
} else {
|
|
116
116
|
filteredTreeData.value = []
|
|
117
117
|
}
|
|
@@ -124,10 +124,10 @@ function onChange (e) {
|
|
|
124
124
|
|
|
125
125
|
function searchInTree (tree, keyword) {
|
|
126
126
|
return tree.reduce((acc, node) => {
|
|
127
|
-
if (node.title.includes(keyword)) {
|
|
127
|
+
if (node[_replaceFields.title].includes(keyword)) {
|
|
128
128
|
acc.push(node)
|
|
129
|
-
} else if (node.children) {
|
|
130
|
-
const childResults = searchInTree(node.children, keyword)
|
|
129
|
+
} else if (node[_replaceFields.children]) {
|
|
130
|
+
const childResults = searchInTree(node[_replaceFields.children], keyword)
|
|
131
131
|
if (childResults.length > 0) {
|
|
132
132
|
acc.push({
|
|
133
133
|
...node,
|