xianniu-ui 0.8.49 → 0.8.50

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": "xianniu-ui",
3
- "version": "0.8.49",
3
+ "version": "0.8.50",
4
4
  "private": false,
5
5
  "main": "lib/xianniu-ui.umd.min.js",
6
6
  "scripts": {
@@ -120,7 +120,7 @@ export default {
120
120
  const res = this.findParent(_value, this.flattenResult).map(
121
121
  (item) => item.cityCode
122
122
  );
123
- console.log('123',res);
123
+ console.log("123", res);
124
124
  return res;
125
125
  }
126
126
  },
@@ -212,14 +212,15 @@ export default {
212
212
  return data.map((item) => {
213
213
  item.level = level;
214
214
  const child = item.subCitys;
215
- if (level >= 2 && this.dataLevel === 2) {
215
+
216
+ // 根据dataLevel判断是否删除subCitys
217
+ if (level >= this.dataLevel) {
216
218
  delete item.subCitys;
217
- }
218
- if (child && child.length) {
219
+ } else if (child && child.length) {
220
+ // 递归调用子节点
219
221
  recursive(child, level);
220
- } else {
221
- delete item.subCitys;
222
222
  }
223
+
223
224
  return item;
224
225
  });
225
226
  };