We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
3.2.6
<script lang="tsx" setup> import { Goods } from '@/api/merchant-v2'; import { reactive } from 'vue'; const state = reactive<{ visible: Boolean; goods: Goods[]; }>({ visible: false, goods: [], }); defineExpose({ open(args: { goods: Goods[] }) { state.visible = true; state.goods = args.goods; }, a: 1, b: 2, log: console.log, }); </script>
import { createApp } from 'vue'; import LiveRecordGoods from './live-record-goods.vue'; /** * 试试动态运行时创建实例,不用直接模板创建实例 */ export function openRecordGoods(args: { goods: Goods[] }) { const app = createApp(LiveRecordGoods); const parent = document.createElement('div'); const instance = app.mount(parent); console.log(instance); // 获取不到实例的方法 (instance as any).open(args); document.body.appendChild(parent); }
能够正常获取到export的方法
获取不到导出的方法
The text was updated successfully, but these errors were encountered:
Should be solved by this already merged PR:
#4606
This is part of 3.2.13
Sorry, something went wrong.
No branches or pull requests
Version
3.2.6
Reproduction link
Steps to reproduce
What is expected?
能够正常获取到export的方法
What is actually happening?
获取不到导出的方法
The text was updated successfully, but these errors were encountered: