Assume I have a method in a Vue.js component that returns a string to be rendered onto the page:
display: (arg) => {
return arg.name
}
And in the relevant HTML:
<div html="component.display(arg)">
</div>
This has worked fine for me until now, but now I want to return HTML with some Vue-bound data on it:
display: (arg) => {
return '<button @click="myMethod(arg)">Click</button>'
}
Obviously, the above doesn't work. My research has led me to believe that the correct approach here would be to create a component and return it, but I just can't seem to get it working. How would I approach this problem?
argis and where it is defined. 2) Whatcomponentis. 3) WheremyMethodis defined