Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(InputNumber): 增加控制显示步进箭头按钮的配置 #715

Merged
merged 1 commit into from
Apr 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions components/input-number/input-number.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
<template #suffix>
<slot name="suffix"></slot>
<div
v-if="showStepAction"
:class="[
`${prefixCls}-actions`,
$slots.suffix && `${prefixCls}-actions-suffix`,
Expand Down Expand Up @@ -89,6 +90,10 @@ export const inputNumberProps = {
type: Number,
default: 1,
},
showStepAction: {
type: Boolean,
default: true,
},
precision: Number,
disabled: Boolean,
placeholder: String,
Expand Down
26 changes: 13 additions & 13 deletions docs/.vitepress/components/inputNumber/common.vue
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
<template>
<FSpace>
<FInputNumber v-model="val" :max="100"></FInputNumber>
{{ val }}
</FSpace>
<FForm>
<FFormItem label="显示步进箭头">
<FSwitch v-model="showStepAction" />
</FFormItem>
</FForm>
<FInputNumber
v-model="val"
:max="100"
:showStepAction="showStepAction"
></FInputNumber>
</template>

<script>
<script setup>
import { ref } from 'vue';

export default {
setup() {
const val = ref(10);
return {
val,
};
},
};
const val = ref(10);
const showStepAction = ref(true);
</script>
19 changes: 10 additions & 9 deletions docs/.vitepress/components/inputNumber/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,16 @@ app.use(FInputNumber);

## Props

| 属性 | 说明 | 类型 | 默认值 |
| :---------- | :--------------- | :------ | :---------- |
| modelValue | v-model 双向绑定 | number | - |
| min | 计数器最小值 | number | `-infinity` |
| max | 计数器最大值 | number | `infinity` |
| step | 计数器步长 | number | `1` |
| disabled | 是否禁用 | boolean | `false` |
| placeholder | 输入框默认提示 | string | - |
| precision | 数值精度 | number | - |
| 属性 | 说明 | 类型 | 默认值 |
|:---------------|:---------------|:--------|:------------|
| modelValue | v-model 双向绑定 | number | - |
| min | 计数器最小值 | number | `-infinity` |
| max | 计数器最大值 | number | `infinity` |
| step | 计数器步长 | number | `1` |
| showStepAction | 显示步进按钮 | boolean | `true` |
| disabled | 是否禁用 | boolean | `false` |
| placeholder | 输入框默认提示 | string | - |
| precision | 数值精度 | number | - |

## Slots

Expand Down