vue2-client 1.8.178 → 1.8.180

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vue2-client",
3
- "version": "1.8.178",
3
+ "version": "1.8.180",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "serve": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve --no-eslint",
@@ -289,7 +289,7 @@ export default {
289
289
  this.getResultText(2)
290
290
  } else if (e === '区') {
291
291
  if (this.model[2].name !== item.name) {
292
- this.tagData.streetData = item.children
292
+ this.tagData.streetData = item.children || []
293
293
  this.model[2].name = item.name
294
294
  this.model[2].code = item.code
295
295
  this.model[3] = { name: '', code: '' }
@@ -300,7 +300,7 @@ export default {
300
300
  this.getResultText(3)
301
301
  } else if (e === '街道') {
302
302
  if (this.model[3].name !== item.name) {
303
- this.tagData.communityData = item.children
303
+ this.tagData.communityData = item.children || []
304
304
  this.model[3].name = item.name
305
305
  this.model[3].code = item.code
306
306
 
@@ -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,