Skip to content

Commit

Permalink
feat(input-number): 支持透传属性至 input 元素
Browse files Browse the repository at this point in the history
  • Loading branch information
yang1206 committed May 8, 2024
1 parent 0b67f89 commit 7547ed0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions docs/components/dentry/inputnumber.md
Expand Up @@ -202,6 +202,10 @@
| disabled | 禁用所有功能 | boolean | `false` |
| readonly | 只读状态禁用输入框操作行为 | boolean | `false` |

### Attrs version

支持透传属性至组件内部的 input 元素。

### Slots

| 名称 | 说明 |
Expand Down
2 changes: 2 additions & 0 deletions packages/nutui/components/inputnumber/inputnumber.vue
Expand Up @@ -100,6 +100,7 @@ export default defineComponent({
addGlobalClass: true,
styleIsolation: 'shared',
},
inheritAttrs: true,
})
</script>

Expand Down Expand Up @@ -127,6 +128,7 @@ export default defineComponent({
:disabled="formDisabled"
:readonly="readonly"
:value="String(modelValue)"
v-bind="$attrs"
@input="(change as any)"
@blur="(blur as any)"
@focus="(focus as any)"
Expand Down

0 comments on commit 7547ed0

Please sign in to comment.