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: wd-input-number自定义按钮图标 #504

Closed
Closed
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
19 changes: 11 additions & 8 deletions docs/component/input-number.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<frame/>

# InputNumber 计数器

# InputNumber 计数器

## 基本用法

Expand Down Expand Up @@ -50,7 +49,6 @@ function handleChange1({ value }) {
<wd-input-number v-model="value" @change="handleChange" disable-input />
```


## 无输入框

设置 `without-input` ,不展示输入框。
Expand Down Expand Up @@ -117,18 +115,23 @@ function handleChange1({ value }) {
| disable-plus | 禁用增加按钮 | boolean | - | false | 0.2.14 |
| disable-minus | 禁用减少按钮 | boolean | - | false | 0.2.14 |


## Events

| 事件名称 | 说明 | 参数 | 最低版本 |
|---------|-----|-----|---------|
| change | 值修改事件 | ` { value }` | - |
| focus | 输入框获取焦点事件 | ` { value, height }` | - |
| blur | 输入框失去焦点事件 | ` { value }` | - |
| change | 值修改事件 | `{ value }` | - |
| focus | 输入框获取焦点事件 | `{ value, height }` | - |
| blur | 输入框失去焦点事件 | `{ value }` | - |

## Slots

| name | 说明 | 参数 | 最低版本 |
| ------ | -------------------- | ----------------------- | -------- |
| left-icon | 左侧图标 | `{ value }` | $LOWEST_VERSION$ |
| right-icon | 右侧图标 | `{ value }` | $LOWEST_VERSION$ |

## 外部样式类

| 类名 | 说明 | 最低版本 |
|-----|------|--------|
| custom-class | 根节点样式 | - |

Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
<template>
<view :class="`wd-input-number ${customClass} ${disabled ? 'is-disabled' : ''} ${withoutInput ? 'is-without-input' : ''}`" :style="customStyle">
<view :class="`wd-input-number__action ${minDisabled || disableMinus ? 'is-disabled' : ''}`" @click="sub">
<wd-icon name="decrease" custom-class="wd-input-number__action-icon"></wd-icon>
<slot name="left-icon" :value="inputValue">
<wd-icon name="decrease" custom-class="wd-input-number__action-icon"></wd-icon>
</slot>
</view>
<view v-if="!withoutInput" class="wd-input-number__inner" @click.stop="">
<input
Expand All @@ -18,7 +20,9 @@
<view class="wd-input-number__input-border"></view>
</view>
<view :class="`wd-input-number__action ${maxDisabled || disablePlus ? 'is-disabled' : ''}`" @click="add">
<wd-icon name="add" custom-class="wd-input-number__action-icon"></wd-icon>
<slot name="right-icon" :value="inputValue">
<wd-icon name="add" custom-class="wd-input-number__action-icon"></wd-icon>
</slot>
</view>
</view>
</template>
Expand Down