2021-12-30 00:44:43 +08:00
|
|
|
::: anchor
|
|
|
|
:::
|
|
|
|
|
2021-12-12 17:39:02 +08:00
|
|
|
::: title 基础使用
|
|
|
|
:::
|
|
|
|
|
|
|
|
::: demo
|
|
|
|
|
|
|
|
<template>
|
|
|
|
<lay-input-number v-model="data"></lay-input-number>
|
|
|
|
<lay-input-number v-model="data2" position="right"></lay-input-number>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
import { ref } from 'vue';
|
|
|
|
const data = ref(0);
|
|
|
|
const data2 = ref(0);
|
|
|
|
export default {
|
|
|
|
setup() {
|
|
|
|
return {
|
|
|
|
data,
|
|
|
|
data2,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
|
|
|
:::
|
|
|
|
|
|
|
|
::: title 尺寸
|
|
|
|
:::
|
|
|
|
|
|
|
|
::: demo
|
|
|
|
|
|
|
|
<template>
|
|
|
|
<div>
|
|
|
|
<div>
|
|
|
|
<lay-input-number></lay-input-number>
|
|
|
|
<lay-input-number size="md"></lay-input-number>
|
|
|
|
<lay-input-number size="sm"></lay-input-number>
|
|
|
|
<lay-input-number size="xs"></lay-input-number>
|
|
|
|
</div>
|
|
|
|
<div>
|
|
|
|
<lay-input-number position="right"></lay-input-number>
|
|
|
|
<lay-input-number position="right" size="md"></lay-input-number>
|
|
|
|
<lay-input-number position="right" size="sm"></lay-input-number>
|
|
|
|
<lay-input-number position="right" size="xs"></lay-input-number>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
</script>
|
|
|
|
|
|
|
|
:::
|
|
|
|
|
|
|
|
::: title 限制数字大小
|
|
|
|
:::
|
|
|
|
|
|
|
|
::: demo
|
|
|
|
|
|
|
|
<template>
|
|
|
|
<lay-input-number :min="0" :max="10"></lay-input-number>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
</script>
|
|
|
|
|
|
|
|
:::
|
|
|
|
|
|
|
|
::: title 数字步数
|
|
|
|
:::
|
|
|
|
|
|
|
|
::: demo
|
|
|
|
|
|
|
|
<template>
|
|
|
|
<lay-input-number :step="10"></lay-input-number>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
</script>
|
|
|
|
|
|
|
|
:::
|
|
|
|
|
|
|
|
::: title 禁用
|
|
|
|
:::
|
|
|
|
|
|
|
|
::: demo
|
|
|
|
|
|
|
|
<template>
|
|
|
|
<p>禁用输入</p>
|
|
|
|
<lay-input-number v-model="data" disabled-input></lay-input-number>
|
|
|
|
<p>全部禁用</p>
|
|
|
|
<lay-input-number v-model="data2" disabled></lay-input-number>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
import { ref } from 'vue';
|
|
|
|
const data = ref(10);
|
|
|
|
const data2 = ref(25);
|
|
|
|
export default {
|
|
|
|
setup() {
|
|
|
|
return {
|
|
|
|
data,
|
|
|
|
data2
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
|
|
|
:::
|
|
|
|
|
|
|
|
|
2022-01-10 01:17:03 +08:00
|
|
|
::: title Input Number 属性
|
2021-12-12 17:39:02 +08:00
|
|
|
:::
|
|
|
|
|
|
|
|
::: table
|
|
|
|
|
|
|
|
| 属性 | 描述 | 类型 | 默认值 |
|
|
|
|
| -------- | ------------- | ------ | ------ |
|
|
|
|
| v-model | 值 | `number` | 0 |
|
|
|
|
| name | 原生属性`name` | `number` | 5 |
|
|
|
|
| disabledInput | 禁用输入框输入 | `boolean` | false |
|
|
|
|
| disabled | 禁用操作 | `boolean` | false |
|
|
|
|
| step | 数字增减的步数 | `number` | 1 |
|
|
|
|
| position | 控制按钮显示位置, 目前除了默认值,只有`right`可填 | `string` | -- |
|
|
|
|
| min | 最小可输入的数 | `number` | -- |
|
|
|
|
| max | 最大可输入的数 | `number` | -- |
|
|
|
|
| size | 尺寸, 可选值`md` / `sm` / `xs`| `string` | 默认为最大尺寸 |
|
|
|
|
|
|
|
|
:::
|
|
|
|
|
2022-01-10 01:17:03 +08:00
|
|
|
::: title Input Number 事件
|
2021-12-12 17:39:02 +08:00
|
|
|
:::
|
|
|
|
|
|
|
|
::: table
|
|
|
|
|
|
|
|
| 属性 | 描述 | 回调参数 |
|
|
|
|
| -------- | -------- | ------ |
|
|
|
|
| change | 值更改触发事件 | (value: number) |
|
|
|
|
|
|
|
|
:::
|
2021-12-16 17:57:59 +08:00
|
|
|
|
|
|
|
::: comment
|
2022-01-12 14:19:06 +08:00
|
|
|
:::
|
|
|
|
|
|
|
|
::: previousNext inputNumber
|
2021-12-16 17:57:59 +08:00
|
|
|
:::
|