Skip to content

Commit

Permalink
fix(slider): step < 1 is not working (#2894)
Browse files Browse the repository at this point in the history
* fix(slider): fix step is not working

* chore: update common

* chore: update demo
  • Loading branch information
uyarn authored Nov 7, 2023
1 parent fe16c16 commit a0501fc
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/select/props.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export default {
borderless: Boolean,
/** 是否可以清空选项 */
clearable: Boolean,
/** 多选情况下,用于设置折叠项内容,默认为 `+N`。如果需要悬浮就显示其他内容,可以使用 collapsedItems 自定义。`value` 表示当前存在的所有标签,`collapsedTags` 表示折叠的标签,泛型 `T` 继承 `SelectOption`,表示选项数据;`count` 表示折叠的数量 */
/** 多选情况下,用于设置折叠项内容,默认为 `+N`。如果需要悬浮就显示其他内容,可以使用 collapsedItems 自定义。`value` 表示当前存在的所有标签,`collapsedTags` 表示折叠的标签,泛型 `T` 继承 `SelectOption`,表示选项数据;`count` 表示折叠的数量, `onClose` 表示移除标签 */
collapsedItems: {
type: Function as PropType<TdSelectProps['collapsedItems']>,
},
Expand Down
3 changes: 2 additions & 1 deletion src/select/select.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ autoWidth | Boolean | false | 宽度随内容自适应 | N
autofocus | Boolean | false | 自动聚焦 | N
borderless | Boolean | false | 无边框模式 | N
clearable | Boolean | false | 是否可以清空选项 | N
collapsedItems | Slot / Function | - | 多选情况下,用于设置折叠项内容,默认为 `+N`。如果需要悬浮就显示其他内容,可以使用 collapsedItems 自定义。`value` 表示当前存在的所有标签,`collapsedTags` 表示折叠的标签,泛型 `T` 继承 `SelectOption`,表示选项数据;`count` 表示折叠的数量;`onClose` 表示移除标签。TS 类型:`TNode<{ value: T[]; collapsedSelectedItems: T[]; count: number; onClose: (index: number) => void }>`[通用类型定义](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts) | N
collapsedItems | Slot / Function | - | 多选情况下,用于设置折叠项内容,默认为 `+N`。如果需要悬浮就显示其他内容,可以使用 collapsedItems 自定义。`value` 表示当前存在的所有标签,`collapsedTags` 表示折叠
的标签,泛型 `T` 继承 `SelectOption`,表示选项数据;`count` 表示折叠的数量, `onClose` 表示移除标签。TS 类型:`TNode<{ value: T[]; collapsedSelectedItems: T[]; count: number, onClose: (index: number) => void }>`[通用类型定义](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts) | N
creatable | Boolean | false | 是否允许用户创建新条目,需配合 filterable 使用 | N
disabled | Boolean | - | 是否禁用组件 | N
empty | String / Slot / Function | - | 当下拉列表为空时显示的内容。TS 类型:`string \| TNode`[通用类型定义](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts) | N
Expand Down
4 changes: 2 additions & 2 deletions src/select/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ export interface TdSelectProps<T extends SelectOption = SelectOption> {
*/
clearable?: boolean;
/**
* 多选情况下,用于设置折叠项内容,默认为 `+N`。如果需要悬浮就显示其他内容,可以使用 collapsedItems 自定义。`value` 表示当前存在的所有标签,`collapsedTags` 表示折叠的标签,泛型 `T` 继承 `SelectOption`,表示选项数据;`count` 表示折叠的数量
* 多选情况下,用于设置折叠项内容,默认为 `+N`。如果需要悬浮就显示其他内容,可以使用 collapsedItems 自定义。`value` 表示当前存在的所有标签,`collapsedTags` 表示折叠的标签,泛型 `T` 继承 `SelectOption`,表示选项数据;`count` 表示折叠的数量, `onClose` 表示移除标签
*/
collapsedItems?: TNode<{ value: T[]; collapsedSelectedItems: T[]; count: number }>;
collapsedItems?: TNode<{ value: T[]; collapsedSelectedItems: T[]; count: number; onClose: (index: number) => void }>;
/**
* 是否允许用户创建新条目,需配合 filterable 使用
* @default false
Expand Down
2 changes: 1 addition & 1 deletion src/slider/_example/input-number.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<t-space direction="vertical" size="60px">
<t-slider v-model="value1" :show-tooltip="true" :inputNumberProps="inputNumberProps" />
<t-slider v-model="value1" :show-tooltip="true" :inputNumberProps="inputNumberProps" :step="0.1" />
<t-slider v-model="value2" range :show-tooltip="true" :inputNumberProps="inputNumberProps" />
</t-space>
</template>
Expand Down
1 change: 0 additions & 1 deletion src/slider/slider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,6 @@ export default mixins(classPrefixMixins).extend({
},
calcInputNumberProps(): object {
const defaultInputNumberProps = {
decimalPlaces: 0,
placeholder: '',
theme: 'column',
};
Expand Down

0 comments on commit a0501fc

Please sign in to comment.