Changes:
const
in piwikHelper.js as that should be vanilla JS.Notes:
postEvent
call is used. This is the simpler approach and works in cases where the twig template was not parameterized. It doesn't work when, eg, the event is called inside a twig for loop, as that can't be translated to a v-for loop in the frontend.<component :is=...
. This allows us to iterate over data in the twig template, save the result and pass it to Vue for use. The <component :is
usage is done specifically so the HTML is directly inserted. Using v-html would require a parent element which is not always acceptable (eg, when a postEvent() call is made between <th>
or <td>
elements.Both approaches will be documented.
@sgiehl hopefully its fixed