diff --git a/helper/attributes.json b/helper/attributes.json index 83cefccd75..cd05dd6520 100644 --- a/helper/attributes.json +++ b/helper/attributes.json @@ -7201,7 +7201,7 @@ "parentFirst", "all" ], - "description": "选中值模式。all 表示父节点和子节点全部会出现在选中值里面;parentFirst 表示当子节点全部选中时,仅父节点在选中值里面;onlyLeaft 表示无论什么情况,选中值仅呈现叶子节点\n\ndefault: onlyLeaf\n\n[docs](https://tdesign.tencent.com/vue-next/components/tree?tab=api#tree-props)" + "description": "选中值模式。all 表示父节点和子节点全部会出现在选中值里面;parentFirst 表示当子节点全部选中时,仅父节点在选中值里面;onlyLeaf 表示无论什么情况,选中值仅呈现叶子节点\n\ndefault: onlyLeaf\n\n[docs](https://tdesign.tencent.com/vue-next/components/tree?tab=api#tree-props)" }, "t-tree/active": { "type": "event", @@ -7772,4 +7772,4 @@ "type": "Number", "description": "水印元素的 `z-index`,默认值写在 CSS 中\n\n[docs](https://tdesign.tencent.com/vue-next/components/watermark?tab=api#watermark-props)" } -} \ No newline at end of file +} diff --git a/helper/web-types.json b/helper/web-types.json index d67f7ab681..03c0c1620d 100644 --- a/helper/web-types.json +++ b/helper/web-types.json @@ -19045,7 +19045,7 @@ }, { "name": "value-mode", - "description": "选中值模式。all 表示父节点和子节点全部会出现在选中值里面;parentFirst 表示当子节点全部选中时,仅父节点在选中值里面;onlyLeaft 表示无论什么情况,选中值仅呈现叶子节点", + "description": "选中值模式。all 表示父节点和子节点全部会出现在选中值里面;parentFirst 表示当子节点全部选中时,仅父节点在选中值里面;onlyLeaf 表示无论什么情况,选中值仅呈现叶子节点", "doc-url": "https://tdesign.tencent.com/vue-next/components/tree?tab=api#tree-props", "type": [ "String" @@ -20447,4 +20447,4 @@ ] } } -} \ No newline at end of file +} diff --git a/src/tree/props.ts b/src/tree/props.ts index a556dfcb84..fffd87de5d 100644 --- a/src/tree/props.ts +++ b/src/tree/props.ts @@ -146,7 +146,7 @@ export default { type: Array as PropType, default: (): TdTreeProps['defaultValue'] => [], }, - /** 选中值模式。all 表示父节点和子节点全部会出现在选中值里面;parentFirst 表示当子节点全部选中时,仅父节点在选中值里面;onlyLeaft 表示无论什么情况,选中值仅呈现叶子节点 */ + /** 选中值模式。all 表示父节点和子节点全部会出现在选中值里面;parentFirst 表示当子节点全部选中时,仅父节点在选中值里面;onlyLeaf 表示无论什么情况,选中值仅呈现叶子节点 */ valueMode: { type: String as PropType, default: 'onlyLeaf' as TdTreeProps['valueMode'], diff --git a/src/tree/tree.md b/src/tree/tree.md index 00aed8789b..c3ecd82c8c 100644 --- a/src/tree/tree.md +++ b/src/tree/tree.md @@ -40,7 +40,7 @@ scroll | Object | - | 懒加载和虚拟滚动。为保证组件收益最大化 transition | Boolean | true | 节点展开折叠时是否使用过渡动画 | N value | Array | [] | 选中值,组件为可选状态时有效。支持语法糖 `v-model` 或 `v-model:value`。TS 类型:`Array` `type TreeNodeValue = string \| number`。[详细类型定义](https://github.com/Tencent/tdesign-vue-next/tree/develop/src/tree/type.ts) | N defaultValue | Array | [] | 选中值,组件为可选状态时有效。非受控属性。TS 类型:`Array` `type TreeNodeValue = string \| number`。[详细类型定义](https://github.com/Tencent/tdesign-vue-next/tree/develop/src/tree/type.ts) | N -valueMode | String | onlyLeaf | 选中值模式。all 表示父节点和子节点全部会出现在选中值里面;parentFirst 表示当子节点全部选中时,仅父节点在选中值里面;onlyLeaft 表示无论什么情况,选中值仅呈现叶子节点。可选项:onlyLeaf/parentFirst/all | N +valueMode | String | onlyLeaf | 选中值模式。all 表示父节点和子节点全部会出现在选中值里面;parentFirst 表示当子节点全部选中时,仅父节点在选中值里面;onlyLeaf 表示无论什么情况,选中值仅呈现叶子节点。可选项:onlyLeaf/parentFirst/all | N onActive | Function | | TS 类型:`(value: Array, context: { node: TreeNodeModel; e?: MouseEvent; trigger: 'node-click' \| 'setItem' }) => void`
节点激活时触发,泛型 `T` 表示树节点 TS 类型 | N onChange | Function | | TS 类型:`(value: Array, context: { node: TreeNodeModel; e?: any; trigger: 'node-click' \| 'setItem' }) => void`
节点选中状态变化时触发,context.node 表示当前变化的选项,泛型 `T` 表示树节点 TS 类型 | N onClick | Function | | TS 类型:`(context: { node: TreeNodeModel; e: MouseEvent }) => void`
节点点击时触发,泛型 `T` 表示树节点 TS 类型 | N diff --git a/src/tree/type.ts b/src/tree/type.ts index 9b7ccc64e2..cd74f777ab 100644 --- a/src/tree/type.ts +++ b/src/tree/type.ts @@ -185,7 +185,7 @@ export interface TdTreeProps { */ modelValue?: Array; /** - * 选中值模式。all 表示父节点和子节点全部会出现在选中值里面;parentFirst 表示当子节点全部选中时,仅父节点在选中值里面;onlyLeaft 表示无论什么情况,选中值仅呈现叶子节点 + * 选中值模式。all 表示父节点和子节点全部会出现在选中值里面;parentFirst 表示当子节点全部选中时,仅父节点在选中值里面;onlyLeaf 表示无论什么情况,选中值仅呈现叶子节点 * @default onlyLeaf */ valueMode?: 'onlyLeaf' | 'parentFirst' | 'all';