- 类星体框架v2 Beta
- Vue 3组成API
- typescript
- 组件模板**
<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)
...
})
- 组件设置**
return {
...
showAction,
showingActionMenu() {
showAction?.value?.show()
},
...
}
返回的方法显示错误
Property 'show' does not exist on type 'Function'.
1条答案
按热度按时间siotufzp1#
ref的类型应为
QMenu
,从类星体框架导入:LIVE DEMO