Skip to content

Commit

Permalink
feat(cascader): cascader
Browse files Browse the repository at this point in the history
  • Loading branch information
LoopZhou committed Dec 22, 2023
1 parent 7f6fd19 commit be662cc
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
1 change: 1 addition & 0 deletions src/cascader/cascader.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ title | String / Slot / Function | - | Typescript:`string \| TNode`。[see mor
value | String / Number | - | `v-model` and `v-model:value` is supported | N
defaultValue | String / Number | - | uncontrolled property | N
visible | Boolean | false | \- | N
checkStrictly | Boolean | false | 父子节点选中状态不再关联,可各自选中或取消 | N
placeholder | String / Slot / Function | - | Typescript:`string \| TNode`[see more ts definition](https://github.com/Tencent/tdesign-mobile-vue/blob/develop/src/common.ts) | N
onChange | Function | | Typescript:`(value: string \| number, selectedOptions: string[]) => void`<br/> | N
onClose | Function | | Typescript:`(trigger: TriggerSource) => void`<br/>[see more ts definition](https://github.com/Tencent/tdesign-mobile-vue/tree/develop/src/cascader/type.ts)。<br/>`type TriggerSource = 'overlay' \| 'close-btn' \| 'finish'`<br/> | N
Expand Down
1 change: 1 addition & 0 deletions src/cascader/cascader.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ title | String / Slot / Function | - | 标题。TS 类型:`string \| TNode`。
value | String / Number | - | 选项值。支持语法糖 `v-model``v-model:value` | N
defaultValue | String / Number | - | 选项值。非受控属性 | N
visible | Boolean | false | 是否展示 | N
checkStrictly | Boolean | false | 父子节点选中状态不再关联,可各自选中或取消 | N
placeholder | String / Slot / Function | 选择选项 | 未选中时的提示文案。TS 类型:`string \| TNode`[通用类型定义](https://github.com/Tencent/tdesign-mobile-vue/blob/develop/src/common.ts) | N
onChange | Function | | TS 类型:`(value: string \| number, selectedOptions: string[]) => void`<br/>值发生变更时触发 | N
onClose | Function | | TS 类型:`(trigger: TriggerSource) => void`<br/>关闭时触发。[详细类型定义](https://github.com/Tencent/tdesign-mobile-vue/tree/develop/src/cascader/type.ts)。<br/>`type TriggerSource = 'overlay' \| 'close-btn' \| 'finish'`<br/> | N
Expand Down
7 changes: 1 addition & 6 deletions src/cascader/cascader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -124,12 +124,7 @@ export default defineComponent({
TTabPanel,
TRadioGroup,
},
// props: TdCascaderProps,
props: {
...TdCascaderProps,
/** 父子节点选中状态不再关联,可各自选中或取消 */
checkStrictly: Boolean,
},
props: TdCascaderProps,
emits: ['change', 'close', 'pick', 'update:modelValue', 'update:value', 'update:visible'],
setup(props, context) {
const { visible, value, modelValue, subTitles, options, keys, checkStrictly } = toRefs(props);
Expand Down
5 changes: 5 additions & 0 deletions src/cascader/props.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,11 @@ export default {
},
/** 是否展示 */
visible: Boolean,
/** 父子节点选中状态不再关联,可各自选中或取消 */
checkStrictly: {
type: Boolean,
default: false,
},
/** 值发生变更时触发 */
onChange: Function as PropType<TdCascaderProps['onChange']>,
/** 关闭时触发 */
Expand Down

0 comments on commit be662cc

Please sign in to comment.