diff --git a/src/components/Actions/Actions.vue b/src/components/Actions/Actions.vue
index 1aa9028ee6..c762e99149 100644
--- a/src/components/Actions/Actions.vue
+++ b/src/components/Actions/Actions.vue
@@ -85,14 +85,43 @@ https://www.w3.org/TR/wai-aria-practices/examples/menu-button/menu-button-action
To be used with `vue-material-design-icons` only. For icon classes use the `default-icon` slot.
It can be used with one or multiple actions.
```
-
-
- Delete
- Reply
-
+
+
+
Toggle multiple action
+
+
+
+
+ Mute
+
+ Delete
+
+
+
+
+
+
```
### Custom icon slot in child elements
@@ -116,8 +145,10 @@ It can be used with one or multiple actions.
rel="noreferrer noopener"
:disabled="disabled"
@[firstActionEventBinding]="execFirstAction">
+
+
+
-
@@ -222,6 +253,12 @@ export default {
components: {
Popover,
+
+ // Component to render the first action icon slot content (vnodes)
+ VNodes: {
+ functional: true,
+ render: (h, context) => context.props.vnodes,
+ },
},
props: {
@@ -393,14 +430,15 @@ export default {
// return the event to bind if the firstActionVNode have an action
firstActionEvent() {
- return this.firstActionVNode
- && this.firstActionVNode.componentOptions
- && this.firstActionVNode.componentOptions.listeners
- && this.firstActionVNode.componentOptions.listeners.click
+ return this.firstActionVNode?.componentOptions?.listeners?.click
},
firstActionEventBinding() {
return this.firstActionEvent ? 'click' : null
},
+ // return the first action icon slot vnodes array
+ firstActionIconSlot() {
+ return this.firstAction?.$slots?.icon
+ },
firstActionClass() {
const staticClass = this.firstActionVNode && this.firstActionVNode.data.staticClass
const dynClass = this.firstActionVNode && this.firstActionVNode.data.class
@@ -654,6 +692,13 @@ export default {
font-weight: bold;
line-height: $icon-size;
+ // image slot
+ /deep/ span {
+ width: $icon-size;
+ height: $icon-size;
+ line-height: $icon-size;
+ }
+
&:before {
content: '';
}
diff --git a/styleguide.config.js b/styleguide.config.js
index 965eb7133e..1e3ca7cdc7 100644
--- a/styleguide.config.js
+++ b/styleguide.config.js
@@ -8,7 +8,7 @@ const newConfig = Object.assign({}, webpackConfig, {
// Ignore eslint
rules: webpackConfig.module.rules.filter(
rule => rule.use !== 'eslint-loader'
- )
+ ),
},
})
@@ -32,8 +32,8 @@ module.exports = {
changeOrigin: true,
ignorePath: true,
secure: false,
- }
- }
+ },
+ },
},
}),