Button
Interactive control for actions, with multiple style variants and states.
Examples
Button types
Button types
Three base types: default / primary / warn
html
<m-button type="default">Default</m-button>
<m-button type="primary" @click="handleClick">Primary</m-button>
<m-button type="warn">Warn</m-button>Size and plain
Size and plain
`size` controls size; `plain` enables the outlined style
html
<m-button size="mini" type="primary">Mini</m-button>
<m-button plain type="primary">Plain</m-button>
<m-button plain type="warn">Warn Plain</m-button>Disabled and loading
Disabled and loading
html
<m-button disabled>Disabled</m-button>
<m-button loading type="primary">Loading</m-button>API
Props
| 属性 | 说明 | 类型 | 默认值 |
|---|---|---|---|
type | Visual style of the button | default | primary | warn | default |
size | Button size | default | mini | default |
plain | Whether the button is outlined | boolean | false |
disabled | Whether the button is disabled | boolean | false |
loading | Whether to show a loading state | boolean | false |
hover-class | CSS class while pressed | string | button-hover |
hover-start-time | Delay after press before pressed style appears (ms) | number | 20 |
hover-stay-time | How long pressed style remains after release (ms) | number | 70 |
form-type | Form action type (must be inside m-form) | submit | reset | - |