OMI 无法接收 Vue 传递过来的方法
This is the code in OMI: tsx import { h, tag, Component } from 'omi'; @tag('y-switch') export default class YSwitch extends Component { static props = { beforeChange: { type: Function, default: null, changed(newValue: Function) { console.log(12312313); console.log(newValue); if (this instanceof YSwitch) { this.update(); } } } }; render(props: any) { console.log(props); return <div>hallo,omi</div>; } } This is the code in Vue: <script setup lang="ts"> import { ref } from 'vue' const changeLoading = async () => { await new Promise((resolve) => setTimeout(resolve, 1000)); return true } </script> <template> <div> <div class="flex justify-center items-center"> <y-switch :before-change="changeLoading"></y-switch> <y-switch :beforeChange="changeLoading"></y-switch> </div> </div> </template> The beforeChange returned is undefeind/null. How can this be solved? Thank you very much!
内容来源: Tencent/omi