|
| 1 | +# How to use |
| 2 | + |
| 3 | +Import into module: |
| 4 | + |
| 5 | +```ts |
| 6 | +import { ButtonModule } from 'ng-devui/button'; |
| 7 | +``` |
| 8 | + |
| 9 | +In the page: |
| 10 | + |
| 11 | +```xml |
| 12 | +<d-button></d-button> |
| 13 | +``` |
| 14 | +# d-button |
| 15 | +## d-button Parameter |
| 16 | + |
| 17 | +| Parameter | Type | Default | Description | Jump to Demo | |
| 18 | +| :---------: | :------------: | :-----: | :--------------------------------------------------------------------------- | --- | |
| 19 | +| id | `string` | -- | Optional. button ID | [Primary Buttons](demo#button-primary)| |
| 20 | +| type | [`IButtonType`](#ibuttontype) | 'button' | Optional. The type is `'button' \| 'submit' \| 'reset'` |[Danger Buttons](demo#button-danger) | |
| 21 | +| bsStyle | [`IButtonStyle`](#ibuttonstyle) | 'primary' | Optional. The style is `'primary' \| 'common' \| 'text' \| 'text-dark' \| 'danger'` | [Common Buttons](demo#button-common) | |
| 22 | +| bsSize | [`IButtonSize`](#ibuttonsize) | 'md' | Optional. The size is `'lg' \| 'md' \| 'sm' \| 'xs'` | [Button Size](demo#button-size) | |
| 23 | +| bsPosition |[`IButtonPosition`](#ibuttonposition) |'default'| Optional. The button position is `'default' \| 'left' \| 'right'` | [Left & Right Buttons](demo#button-left-right) | |
| 24 | +| bordered | `boolean` | false | Optional. Indicating whether a border exists | [Auto-focus Buttons](demo#button-auto-focus)| |
| 25 | +| icon | `string` | -- | Optional. Customized button icon | [Icon Buttons](demo#button-icon) | |
| 26 | +| showLoading | `boolean` | false | Optional. Indicating whether to display the loading prompt | [Loading Buttons](demo#button-loading) | |
| 27 | +| width | `number` | -- | Optional. Button width |[Combinations of Primary & Common Buttons](demo#button-primary-and-common) | |
| 28 | +| disabled | `boolean` | false | Optional. Indicating whether to disable the button | [Primary Buttons](demo#button-primary) | |
| 29 | +| autofocus | `boolean` | false | Optional. Indicating whether to automatically obtain the focus during button loading | [Auto-focus Buttons](demo#button-auto-focus) | |
| 30 | + |
| 31 | +## d-button Event |
| 32 | + |
| 33 | +| Parameter | Type | Description | Jump to Demo | |
| 34 | +| :------: | :-----------------: | :-------------------------------------------------------------------------------------- | ---------------------------------------------- | |
| 35 | +| btnClick | `EventEmitter<MouseEvent>` | Optional. Solve the click event is triggered when button is disabled. After the mouse is clicked, the mouse event object is returned | [Loading Buttons](demo#button-loading)| |
| 36 | + |
| 37 | +# d-button-group |
| 38 | + |
| 39 | +## d-button-group parameter |
| 40 | + |
| 41 | +| Parameter | Type | Default | Description | Jump to Demo | |
| 42 | +| :---------: | :------------: | :-----: | :--------------------------------------------------------------------------- | --- | |
| 43 | +| size | [`IButtonGroupSize`](#ibuttongroupsize) | 'md' | Optional. The size is `'lg' \| 'md' \| 'sm' \| 'xs'` | [Button Group](demo#button-groups) | |
| 44 | + |
| 45 | +# Interface & Type Definition |
| 46 | +### IButtonType |
| 47 | + |
| 48 | +The default value is 'button', indicating the button type. |
| 49 | + |
| 50 | +```ts |
| 51 | +export type IButtonType = 'button' | 'submit' | 'reset'; |
| 52 | +``` |
| 53 | + |
| 54 | +### IButtonStyle |
| 55 | + |
| 56 | +The default value is 'primary', indicating the button style. |
| 57 | + |
| 58 | +```ts |
| 59 | +export type IButtonStyle = 'common' | 'primary' | 'text' | 'text-dark' | 'danger'; |
| 60 | +``` |
| 61 | + |
| 62 | +### IButtonPosition |
| 63 | + |
| 64 | +The default value is 'default', indicating the button position. |
| 65 | + |
| 66 | +```ts |
| 67 | +export type IButtonPosition = 'left' | 'right' | 'default'; |
| 68 | +``` |
| 69 | + |
| 70 | +### IButtonSize |
| 71 | +The default value is 'md', indicating the button size. |
| 72 | + |
| 73 | +```ts |
| 74 | +export type IButtonSize = 'lg' | 'md' | 'sm' | 'xs'; |
| 75 | +``` |
| 76 | + |
| 77 | +### IButtonGroupSize |
| 78 | +The default value is 'md', indicating the button-group size. |
| 79 | + |
| 80 | +```ts |
| 81 | +export type IButtonGroupSize = 'lg' | 'md' | 'sm' | 'xs'; |
| 82 | +``` |
0 commit comments