@bsgoal/common 2.14.4 → 2.14.5

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": "@bsgoal/common",
3
- "version": "2.14.4",
3
+ "version": "2.14.5",
4
4
  "private": false,
5
5
  "files": [
6
6
  "dist",
@@ -2,7 +2,7 @@
2
2
  * @Author: canlong.shen
3
3
  * @Date: 2023-04-21 08:43:33
4
4
  * @LastEditors: canlong.shen
5
- * @LastEditTime: 2023-06-25 17:37:08
5
+ * @LastEditTime: 2023-06-27 09:31:45
6
6
  * @FilePath: \common\src\components\bsgoal-base-tree\index.vue
7
7
  * @Description: 虚拟化树型结构 公共组件
8
8
  *
@@ -66,6 +66,20 @@ const props = defineProps({
66
66
  initNode: {
67
67
  type: [Function],
68
68
  default: null
69
+ },
70
+ /**
71
+ * 节点的 key
72
+ */
73
+ nodeKey: {
74
+ type: [String],
75
+ default: 'key'
76
+ },
77
+ /**
78
+ * 默认展开的节点
79
+ */
80
+ expandedKeys: {
81
+ type: [Array],
82
+ default: () => []
69
83
  }
70
84
  })
71
85
 
@@ -132,8 +146,8 @@ const loadNode = async (node, resolve, props) => {
132
146
  }
133
147
 
134
148
  const lazyGet = computed(() => {
135
- const { lazyLoad = null , initNode = null} = props
136
- if(lazyLoad && initNode ){
149
+ const { lazyLoad = null, initNode = null } = props
150
+ if (lazyLoad && initNode) {
137
151
  return true
138
152
  }
139
153
  return false
@@ -169,6 +183,7 @@ const handleItemAdd = (node = null, data = {}) => {
169
183
  :expand-on-click-node="false"
170
184
  :props="treeProps"
171
185
  :filter-node-method="filterNode"
186
+ :default-expanded-keys="expandedKeys"
172
187
  @node-click="clickNodeTree"
173
188
  >
174
189
  <template #default="{ node, data }">
@@ -180,7 +195,7 @@ const handleItemAdd = (node = null, data = {}) => {
180
195
  <!-- E 节点名称 -->
181
196
  <!-- S 操作符号 -->
182
197
  <span class="base_tree_node_icon" v-show="data.hasIcon">
183
- <el-icon color="var(--el-color-primary)" @click.stop="handleItemAdd(node, data)">
198
+ <el-icon color="var(--el-color-primary)" @click.stop="handleItemAdd(node, data)">
184
199
  <Plus />
185
200
  </el-icon>
186
201
  </span>