Skip to content

Commit

Permalink
Use render function in Actions component
Browse files Browse the repository at this point in the history
Signed-off-by: Raimund Schlüßler <[email protected]>
  • Loading branch information
raimund-schluessler committed Aug 6, 2022
1 parent 3d9cb64 commit 4f4280d
Show file tree
Hide file tree
Showing 2 changed files with 258 additions and 372 deletions.
21 changes: 16 additions & 5 deletions src/components/ActionButton/ActionButton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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
-
Expand All @@ -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>
Expand All @@ -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>
```
Expand All @@ -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>
Expand All @@ -86,6 +92,11 @@ If you're using a long text you can specify a title
Delete,
Plus,
},
methods: {
showMessage(msg) {
alert(msg)
},
},
}
</script>

Expand Down
Loading

0 comments on commit 4f4280d

Please sign in to comment.