提交 e97f6bc6 编写于 作者: 雪洛's avatar 雪洛

fix: 修复$callMethod测试例错误

上级 f7a7ae66
......@@ -21,8 +21,8 @@
this.component = this.$refs['comp'] as ComponentPublicInstance;
},
methods: {
callMethod() {
return this.component!.$callMethod('test', 'call-method-define-expose')
callMethod() : string {
return this.component!.$callMethod('test', 'call-method-define-expose') as string
}
}
}
......
......@@ -3,7 +3,7 @@
</template>
<script setup>
function test(name: string) {
function test(name : string) : string {
return `hello ${name}`
}
defineExpose({
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册