leisure-core 0.5.83 → 0.5.85

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.
@@ -4,6 +4,7 @@
4
4
  v-bind="$attrs"
5
5
  v-on="$listeners"
6
6
  clearable
7
+ :ref="elcascader"
7
8
  :props="props"
8
9
  @change="handleChange"
9
10
  ></el-cascader>
@@ -29,6 +30,10 @@ export default {
29
30
  type: Array,
30
31
  default: () => [],
31
32
  },
33
+ elcascader: {
34
+ type: String,
35
+ default: "",
36
+ },
32
37
  },
33
38
  data() {
34
39
  return {
@@ -87,9 +92,20 @@ export default {
87
92
  let selectValue = {};
88
93
  selectValue.code = currentValue;
89
94
  if (!selectValue.code || selectValue.code.length <= 0) return;
90
- let names = this.$refs["elcascader"].getCheckedNodes()[0].pathLabels;
91
- selectValue.name = names.join("");
92
- this.$emit("areaChange", selectValue);
95
+ let cascader = this.$refs[this.elcascader];
96
+ if (cascader) {
97
+ const nodes = cascader.getCheckedNodes();
98
+ if (nodes && nodes.length > 0) {
99
+ console.log(nodes[0].pathLabels);
100
+ const labels = nodes[0].pathLabels;
101
+ selectValue.name = labels.join("");
102
+ this.$emit("areaChange", selectValue);
103
+ } else {
104
+ console.log("area control node 不存:");
105
+ }
106
+ } else {
107
+ console.log("area control err:", "elcascader ref 不存在");
108
+ }
93
109
  },
94
110
  },
95
111
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "leisure-core",
3
- "version": "0.5.83",
3
+ "version": "0.5.85",
4
4
  "description": "leisure-core是京心数据基于vue2.x开发的一套后台管理系统桌面端组件库,封装了大量实用的UI控件模板,非常方便开发者快速搭建前端应用",
5
5
  "private": false,
6
6
  "author": "北方乐逍遥(zcx7878)",