-
Notifications
You must be signed in to change notification settings - Fork 88
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use render function in Actions component
Signed-off-by: Raimund Schlüßler <[email protected]>
- Loading branch information
1 parent
3d9cb64
commit 4f4280d
Showing
2 changed files
with
258 additions
and
372 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 |
---|---|---|
|
@@ -3,6 +3,7 @@ | |
- | ||
- @author John Molakvoæ <[email protected]> | ||
- @author Marco Ambrosini <[email protected]> | ||
- @author Raimund Schlüßler <[email protected]> | ||
- | ||
- @license GNU AGPL version 3 or any later version | ||
- | ||
|
@@ -27,19 +28,19 @@ This component is made to be used inside of the [Actions](#Actions) component sl | |
```vue | ||
<template> | ||
<Actions> | ||
<ActionButton @click="alert('Delete')"> | ||
<ActionButton @click="showMessage('Delete')"> | ||
<template #icon> | ||
<Delete :size="20" /> | ||
</template> | ||
Delete | ||
</ActionButton> | ||
<ActionButton :close-after-click="true" @click="alert('Delete and close menu')"> | ||
<ActionButton :close-after-click="true" @click="showMessage('Delete and close menu')"> | ||
<template #icon> | ||
<Delete :size="20" /> | ||
</template> | ||
Delete and close | ||
</ActionButton> | ||
<ActionButton :disabled="true" @click="alert('Disabled')"> | ||
<ActionButton :disabled="true" @click="showMessage('Disabled')"> | ||
<template #icon> | ||
<Delete :size="20" /> | ||
</template> | ||
|
@@ -54,6 +55,11 @@ This component is made to be used inside of the [Actions](#Actions) component sl | |
components: { | ||
Delete, | ||
}, | ||
methods: { | ||
showMessage(msg) { | ||
alert(msg) | ||
}, | ||
}, | ||
} | ||
</script> | ||
``` | ||
|
@@ -63,13 +69,13 @@ If you're using a long text you can specify a title | |
```vue | ||
<template> | ||
<Actions> | ||
<ActionButton icon="icon-add" @click="alert('Add')"> | ||
<ActionButton icon="icon-add" @click="showMessage('Add')"> | ||
<template #icon> | ||
<Plus :size="20" /> | ||
</template> | ||
Add new | ||
</ActionButton> | ||
<ActionButton title="Long button" @click="alert('Delete')"> | ||
<ActionButton title="Long button" @click="showMessage('Delete')"> | ||
<template #icon> | ||
<Delete :size="20" /> | ||
</template> | ||
|
@@ -86,6 +92,11 @@ If you're using a long text you can specify a title | |
Delete, | ||
Plus, | ||
}, | ||
methods: { | ||
showMessage(msg) { | ||
alert(msg) | ||
}, | ||
}, | ||
} | ||
</script> | ||
|
||
|
Oops, something went wrong.