component template
<q-btn
@click.stop="showingActionMenu()"
color="grey-7"
round
flat
icon="more_vert"
>
<q-menu
ref="showAction"
auto-close
>
...
</q-menu>
</q-btn>
setup() {
...
const showAction = ref<Function | null>(null)
...
})
component setup
return {
...
showAction,
showingActionMenu() {
showAction?.value?.show()
},
...
}
returned method shows error
Property 'show' does not exist on type 'Function'.
The type of the ref should be QMenu
which is imported from quasar framework:
import { QMenu } from 'quasar'
...
setup() {
...
const showAction = ref<QMenu| null>(null)
...
return {
...
showAction,
showingActionMenu() {
showAction.value?.show()
},
...
}
}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.