Hi everybody,
I defined a window component with a onclick event in the template like that :
<window
id="windowMD"
:width="'300px'"
:title="'Window title'"
:actions="actions"
:content="{
url: 'http://localhost:3100/api/metadata',
dataType: 'json',
iframe: false,
template:`
<ul>
# for (let i=0; i < data.mediaRequests.length; i++){ #
<li style='padding-bottom:5px;' onclick='#=eventClick(data.mediaRequests[i])#' >
#= data.mediaRequests[i].id #
</li>
# } #
</ul>
`
}"
>
</window>
But I have a problem when I click in a element in the list. I have a "the function is not defined" even if I declared it
[...] methods: { eventClick: function(data) { console.log(data); }, }, [...]
I see in this documentation that the function must be declared in the global scope but I need to use "$emits" to transfer data to parent component and I don't think it is possible in global scope. Even if it is possible, I have the same problem with the function ....
is there a solution to my problem ?
Thanks.