//插件 uni_modules\wq-opharm\utssdk\app-harmony\index.uts
export function appone(){
console.info(` ----aaa `)
}
//uni_modules\wq-opharm\utssdk\interface.uts
export type appone =() =>void
//页面\pages\index.vue
<template>
<view class="content">
<button class="button" @click="openAppProductBtn">打开应用市场</button>
</view>
</template>
<script>
import { appone} from "@/uni_modules/wq-opharm"
export default {
data() {
return {
}
},
onLoad() {
},
methods: {
openAppProductBtn() {
appone();
}
}
}
</script>
去掉函数 appone(); web正常运行
加上appone(); 报错
16:11:58.906 [vite] connecting...
16:11:58.906 [vite] connected.
16:11:58.982 [plugin:vite:import-analysis] Cannot find module 'D:/....../harm/uni_modules/wq-opharm' from 'D:/....../harm/pages/index/index.vue'
16:11:58.982 at pages/index/index.vue:1:0
16:11:59.102 App Launch at App.vue:4
16:11:59.102 App Show at App.vue:7
16:11:59.188 [Vue warn]: Unhandled error during execution of async component loader \n at <AsyncComponentWrapper>\nat <PageBody>\nat <Page>\nat <Anonymous>\nat <Layout>\nat <App>
16:11:59.231 [TypeError] {message: "Failed to fetch dynamically imported module: http://localhost:5173/pages/index/index.vue"}
2***@qq.com (作者)
好的
2025-09-15 17:05