在script setup中怎么传递emitter实例,用能正确的使用Events 泛型
export const emitter = mitt<Events>()
会报错误
./src/components/ValidateForm.vue?vue&type=script&lang=ts&setup=true (./node_modules/cache-loader/dist/cjs.js??ref--14-0!./node_modules/ts-loader??ref--14-1!./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader-v16/dist??ref--1-1!./src/components/ValidateForm.vue?vue&type=script&lang=ts&setup=true)
Module Error (from ./node_modules/vue-loader-v16/dist/index.js):
[@vue/compiler-sfc] <script setup> cannot contain ES module exports. If you are using a previous version of <script setup>, please consult the updated RFC at https://github.com/vuejs/rfcs/pull/227.
/Users/wuhelong/Documents/视频学习课程/慕课网/Vue3.0+Typescript/zheye/src/components/ValidateForm.vue
14 | type ValidateFunc = () => boolean
15 | // 实例化 mitt
16 | type Events = { 'form-item-created': ValidateFunc }
| ^
17 | export const emitter = mitt<Events>()
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
18 | const emit = defineEmits(['form-submit'])