// 导出类
export default class VideoPlayer {
private videoView?: VideoView = null;
private videoPath = '';
private autoPlay = false;
...
}
// 导入类
import VideoPlayer from '@/uni_modules/lx-videoplayer';
![乐天愁](http://img-cdn-tc.dcloud.net.cn/uploads/avatar/000/22/48/42_avatar_mid.jpg?v=0)
- 发布:2022-09-24 11:29
- 更新:2022-10-18 14:52
- 阅读:766
产品分类: uniapp/App
PC开发环境操作系统: Windows
PC开发环境操作系统版本号: win10
HBuilderX类型: 正式
HBuilderX版本号: 3.6.4
手机系统: Android
手机系统版本号: Android 12
手机厂商: 华为
手机机型: Mate30E
页面类型: vue
vue版本: vue3
打包方式: 云端
项目创建方式: HBuilderX
示例代码:
操作步骤:
- 创建uts插件
- 在index.uts中导出类
- 在index.vue页面引用
- 创建uts插件
- 在index.uts中导出类
- 在index.vue页面引用
预期结果:
可以正常导入
可以正常导入
实际结果:
提示错误:
11:22:49.119 Error when using sourcemap for reporting an error: Can't resolve original location of error.
11:22:49.120 'default' is not exported by ........\workspace\uts-player\uni_modules\lx-videoplayer\utssdk\app-android\index.uts, imported by ........\workspace\uts-player\pages\index\index.vue
提示错误:
11:22:49.119 Error when using sourcemap for reporting an error: Can't resolve original location of error.
11:22:49.120 'default' is not exported by ........\workspace\uts-player\uni_modules\lx-videoplayer\utssdk\app-android\index.uts, imported by ........\workspace\uts-player\pages\index\index.vue
bug描述:
在uts插件里通过export default导出类,在页面引用的时候提示错误:
11:22:49.119 Error when using sourcemap for reporting an error: Can't resolve original location of error.
11:22:49.120 'default' is not exported by ........\workspace\uts-player\uni_modules\lx-videoplayer\utssdk\app-android\index.uts, imported by ........\workspace\uts-player\pages\index\index.vue
2 个回复
DCloud_UNI_FXY
已确认,下个版本修复
目前可以先采用非default的导出class
DCloud_UNI_Anne
HBuilderX3.6.7-alpha已修复