@deanwu/vue-component-library 1.3.63 → 1.3.65

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.
@@ -45707,7 +45707,7 @@ function renderExpandButton(h, row) {
45707
45707
  "style": `margin-left:${row.expandData.level * 25 + 20}px;`
45708
45708
  }, [h("button-group", [h("c-table-button", {
45709
45709
  "on": {
45710
- "click": e => this.store.expandAddHandle(row, e)
45710
+ "click": e => this.store.expandAddHandle(row.expandData.parent, e)
45711
45711
  }
45712
45712
  }, [this.$t(row.name)])])])])])];
45713
45713
  }
@@ -46233,16 +46233,23 @@ var es_array_unshift = __webpack_require__("3c65");
46233
46233
  expandAddHandle(row, e) {
46234
46234
  e && e.stopPropagation();
46235
46235
  let col = this.expandCol;
46236
- var parent = row.expandData.parent;
46237
- col.$emit('add', parent, data => {
46238
- let row = this.createRow({
46239
- data,
46240
- expandLevel: parent.expandData.level + 1,
46241
- expandParent: parent
46242
- }, {
46243
- [this.selectorCol ? this.selectorCol.name : '_selected']: parent.data[this.selectorCol ? this.selectorCol.name : '_selected']
46236
+ col.$emit('add', row, data => {
46237
+ if (!Array.isArray(data)) {
46238
+ data = [data];
46239
+ }
46240
+ if (!row.expandData.children) {
46241
+ row.expandData.children = [];
46242
+ }
46243
+ data.forEach(item => {
46244
+ let child = this.createRow({
46245
+ data: item,
46246
+ expandLevel: row.expandData.level + 1,
46247
+ expandParent: row
46248
+ }, {
46249
+ [this.selectorCol ? this.selectorCol.name : '_selected']: row.data[this.selectorCol ? this.selectorCol.name : '_selected']
46250
+ });
46251
+ row.expandData.children.push(child);
46244
46252
  });
46245
- parent.expandData.children.push(row);
46246
46253
  });
46247
46254
  },
46248
46255
  sortHandle(row, type, e) {