qtsk-vue3 0.0.48 → 0.0.49

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.
@@ -66,16 +66,18 @@ const props = defineProps({
66
66
  type: Object,
67
67
  default: () => ({
68
68
  children: 'children',
69
- label: 'name'
69
+ label: 'name',
70
+ indeterminate: 'indeterminate'
70
71
  })
71
- }
72
+ },
73
+ type: String
72
74
  })
73
75
 
74
76
  const emits = defineEmits(['handleTree', 'handleNode'])
75
77
  // 点击节点
76
78
  const handleNodeClick = (data) => {
77
79
  console.log('data', data)
78
- emits('handleNode', data)
80
+ emits('handleNode', data, props.type)
79
81
  }
80
82
 
81
83
  // 获取选中的节点
@@ -85,11 +87,26 @@ const getCheckedKeys = () => {
85
87
 
86
88
  //当复选框被点击的时候触发, 用于获取所有的选中数据
87
89
  const checkChange = () => {
90
+ console.log('treeRef.value.getCheckedKeys()', treeRef.value.getCheckedKeys())
88
91
  // modelValue.value = treeRef.value.getCheckedKeys()
89
92
  }
90
93
  const handleCheck = (currentNode, {checkedKeys}) => {
91
94
  console.log('currentNode', currentNode)
95
+ console.log('checkedKeys', checkedKeys)
96
+ modelValue.value = checkedKeys
97
+ // treeRef.value.setCheckedKeys(checkedKeys)
98
+ /* const values = modelValue.value
92
99
  let keys = []
100
+ if (checkedKeys.length) {
101
+ // 选中时,将当前节点设为唯一选中
102
+ keys = [currentNode[props.nodeKey]];
103
+ } else {
104
+ // 取消选中时,清空所有选中(可选,根据需求决定是否允许取消)
105
+ keys = [];
106
+ }
107
+ modelValue.value = keys */
108
+
109
+ /* let keys = []
93
110
  if (checkedKeys.length) {
94
111
  // 选中时,将当前节点设为唯一选中
95
112
  keys = [currentNode[props.nodeKey]];
@@ -98,7 +115,7 @@ const handleCheck = (currentNode, {checkedKeys}) => {
98
115
  keys = [];
99
116
  }
100
117
  modelValue.value = keys
101
- treeRef.value.setCheckedKeys(keys);
118
+ treeRef.value.setCheckedKeys(keys); */
102
119
  }
103
120
  const handleOperations = (data, type) => {
104
121
  emits('handleTree', data, type)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "qtsk-vue3",
3
- "version": "0.0.48",
3
+ "version": "0.0.49",
4
4
  "description": "vue3版组件库",
5
5
  "main": "./package/index.js",
6
6
  "scripts": {