-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(dialog): add accent and accept-disabled property
- Loading branch information
Showing
2 changed files
with
62 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,49 @@ | ||
## Usage | ||
|
||
```html | ||
<mdc-dialog ref="dialog" title="Title" accept="Accept" cancel="Decline" | ||
@accept="onAccept" @cancel="onDecline"> | ||
{{ dialogText }} | ||
</mdc-dialog> | ||
``` | ||
|
||
```javascript | ||
var vm = new Vue({ | ||
data: { | ||
dialogText: 'Lorem ipsum dolor sit amet, ...', | ||
}, | ||
methods: { | ||
showDialog () { | ||
this.$refs.dialog.show() | ||
}, | ||
onAccept () { | ||
console.log('accepted') | ||
}, | ||
onDecline () { | ||
console.log('declined') | ||
}, | ||
} | ||
}) | ||
``` | ||
|
||
### props | ||
|
||
| props | Type | Default | Description | | ||
|-------|------|---------|-------------| | ||
|`title`|String| required | the dialog title | | ||
|`accept`|String|`'Ok'`| the dialog accept button text | | ||
|`cancel`| String| `'cancel'`| the dialog cancel button text | | ||
|`scrollable`| String|| whether the dialog is scrollable | | ||
|`@accept`| String|| emitted when dialog is accepted | | ||
|`@cancel`| String|| emitted when dialog is cancelled | | ||
|`dark`| boolean| | set the dark theme | | ||
|
||
|
||
### Reference | ||
- <https://material.io/components/web/catalog/dialogs> | ||
|
||
## Usage | ||
|
||
```html | ||
<mdc-dialog ref="dialog" | ||
title="Title" accept="Accept" cancel="Decline" | ||
@accept="onAccept" @cancel="onDecline" | ||
>{{ dialogText }}</mdc-dialog> | ||
``` | ||
|
||
```javascript | ||
var vm = new Vue({ | ||
data: { | ||
dialogText: 'Lorem ipsum dolor sit amet, ...', | ||
}, | ||
methods: { | ||
showDialog () { | ||
this.$refs.dialog.show() | ||
}, | ||
onAccept () { | ||
console.log('accepted') | ||
}, | ||
onDecline () { | ||
console.log('declined') | ||
}, | ||
} | ||
}) | ||
``` | ||
|
||
### props | ||
|
||
| props | Type | Default | Description | | ||
|-------|------|---------|-------------| | ||
|`title`|String| required | the dialog title | | ||
|`accept`|String|`'Ok'`| the dialog accept button text | | ||
|`accept-disabled`|String|`'Ok'`| the dialog accept button text | | ||
|`cancel`| String| `'cancel'`| the dialog cancel button text | | ||
|`scrollable`| Boolean| false | whether the dialog is scrollable | | ||
|`accent`| Boolean| false | set accented style to the footer buttons | | ||
|
||
### events | ||
|
||
| props | args | Description | | ||
|---------|------|--------------| | ||
|`@accept`| none | emitted when dialog is accepted | | ||
|`@cancel`| none | emitted when dialog is cancelled | | ||
|
||
### Reference | ||
|
||
<https://material.io/components/web/catalog/dialogs> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters