1
How do I use an event in an element rendered by the v-html directive? The Vue (@event) events do not work.. I tried calling a function by onclick, but it is not found.
<button onclick="test()" class="botao">Adicionar ao carrinho</button> // NÃO FUNCIONA
<button onclick="console.log('Clicado')" class="botao">Adicionar ao carrinho</button> //FUNCIONA
The above codes are being rendered by v-html as in the example below:
<div v-html="<button onclick="test()" class="botao">Adicionar ao Carrinho</button>">
</div>