In router components, can "onclick" access methods.xxx(), not using @click shorthand

<template>
    <button @click="test">a<button>
    <button onclick=" any way to call  test()  here?  ">b</button
</template>

<script>
return{
 methods:{
   test(){}
 }
}
</script>

Hi, in router components, can “onclick” access methods.xxx(), without using @click shorthand?

Thanks.

If you give your page element a name:

<div class="page" data-name="pages.mypage">

You can access your component methods like this:

$$('[data-name="pages.mypage"]')[0].f7Component.myMethod()

2 Likes

thank you , what a hack!