I am working on a component which renders "buttons" - an icon which trigger some function on click.
I'm passing the data as props, but the icons are actually components since I am using mdue library and I have problem rendering them properly.
My buttons array which I pass as props and icons import:
import {
FormatBold, FormatItalic,
} from 'mdue';
buttons: [
{ icon: FormatBold, onClick: someFunction() },
{ icon: FormatItalic, onClick: someFunction() },
]
And here's how I am trying to display them in my other component
<div v-for="(button, index) in buttons" :key="index" @click="someFunction">
{{ button.icon }}
</div>
What is displayed on the screen:
{ "name": "" }
{ "name": "" }
The proper way of using icons from that library:
<template>
<format-bold></format-bold>
</template>
onClick: someFunction()and@click="someFunction"is wrong, most likly it should beonClick: someFunctionand@click="button.onClick"- Lawrence Cherone