mirror of
https://github.com/tusen-ai/naive-ui.git
synced 2025-03-01 13:36:55 +08:00
feat(button): attr-type prop to set type attr
This commit is contained in:
parent
e67a2b65e9
commit
90ed52aee4
@ -18,6 +18,7 @@ group
|
||||
### Button Props
|
||||
|Name|Type|Default|Description|
|
||||
|-|-|-|-|
|
||||
|attr-type|`'button' \| 'submit' \| 'reset'`|`'button'`|The DOM `type` attribute of the button.|
|
||||
|block|`boolean`|`false`||
|
||||
|circle|`boolean`|`false`||
|
||||
|color|`string`|`null`|Only support `#FFF`, `#FFFFFF`, `rgb(0, 0, 0)` formatted colors.|
|
||||
|
@ -19,6 +19,7 @@ debug
|
||||
### Button Props
|
||||
|名称|类型|默认值|说明|
|
||||
|-|-|-|-|
|
||||
|attr-type|`'button' \| 'submit' \| 'reset'`|`'button'`|按钮的 DOM `type` 属性|
|
||||
|block|`boolean`|`false`||
|
||||
|circle|`boolean`|`false`||
|
||||
|color|`string`|`null`|只支持形如 `#FFF`, `#FFFFFF`, `rgb(0, 0, 0)` 的颜色|
|
||||
|
@ -24,6 +24,7 @@
|
||||
[`n-${syntheticTheme}-theme`]: syntheticTheme,
|
||||
}"
|
||||
:tabindex="syntheticFocusable ? 0 : -1"
|
||||
:type="attrType"
|
||||
@click="handleClick"
|
||||
@blur="handleBlur"
|
||||
@mousedown="handleMouseDown"
|
||||
@ -236,6 +237,12 @@ export default {
|
||||
validator (value) {
|
||||
return ['secondary', 'tertiary'].includes(value)
|
||||
}
|
||||
},
|
||||
attrType: {
|
||||
default: 'button',
|
||||
validator (value) {
|
||||
return ['button', 'submit', 'reset'].includes(value)
|
||||
}
|
||||
}
|
||||
},
|
||||
data () {
|
||||
|
Loading…
Reference in New Issue
Block a user