Skip to content

Conversation

@jamesWalker55
Copy link
Contributor

This allows using any arbitrary icon as the argument to 'icon', as long as the icon is a component.

Related issue: #12

Example usage with antfu/unplugin-icons:

<script lang="ts" setup>
import VueFileToolbarMenu from 'vue-file-toolbar-menu';
import Icon from '~icons/ph/tag';

import {computed} from 'vue';

const my_menu = computed(() => [
      {
        text: 'My Menu', menu: [
          {text: 'Item 1', click: () => alert('Action 1')},
          {text: 'Item 2', icon: 'sentiment_very_satisfied'},
          {text: 'Item 3', icon: Icon},
        ],
      },
      {
        icon: Icon,
        click: () => alert("Icon button!"),
      },
    ],
);
</script>

<template>
  <VueFileToolbarMenu :content="my_menu"/>
</template>

@motla motla merged commit 0855ea2 into motla:master Nov 20, 2022
@motla
Copy link
Owner

motla commented Nov 20, 2022

Hi @jamesWalker55
Thank you very much for your contribution!! 🙂
I just released v1.5.0 (Vue2) and v2.2.0 (Vue3) including your commits.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants