I am facing a challenge with passing a function link to the child component in Vue. Although it is functioning correctly, the code appears in HTML format. How can I enhance this?
In my Vue instance, I have:
app = new Vue({
... some code
data: {
onAppClose: null,
onAppSend: null
}
})
I would like to add any function from the global window or register one within the Vue instance.
app.onSend = () => console.log('data')
Subsequently, I need to pass this function to the child component:
<div id="app">
<dynamsoft-component v-if="displayComponent"
:docs="docs"
:onAppSend="onSend"
:onAppClose="onClose"
></dynamsoft-component>
</div>
However, when checking the HTML template in the console, it shows:
<div id="app">
<div onappsend="()=>{}" onappclose="function (data) {
console.warn('dwdawad')
console.log('data')
}"></div>
</div>