f***@qq.com
f***@qq.com
  • 发布:2023-12-14 14:18
  • 更新:2024-03-06 16:32
  • 阅读:260

【报Bug】Hello uni-app模板下easycom配置与leftwindow冲突报错:uni is not defined

分类:uni-app

产品分类: uniapp/H5

PC开发环境操作系统: Windows

PC开发环境操作系统版本号: win10

HBuilderX类型: 正式

HBuilderX版本号: 3.98

浏览器平台: Chrome

浏览器版本: 119.0.6045.124

项目创建方式: HBuilderX

示例代码:
{  
 "easycom": {  
    "^u-(.*)": "uview-ui/components/u-$1/u-$1.vue",  
  }  
}

操作步骤:

用Hello uni-app模板建的uni-app项目,依uview-ui官网的操作步骤使用npm安装uview-ui@2.0.36,在pages.json里配置easycom,运行到chrome报错:Uncaught ReferenceError: uni is not defined,如果不配置easycom或去掉leftWindow页面显示正常。

预期结果:

Hello uni-app模板可以正常安装uview-ui最新版本,并且支持easycom的配置,同时在pc端浏览器里可正常运行。

实际结果:

报错:Uncaught ReferenceError: uni is not defined

bug描述:

用Hello uni-app模板建的uni-app项目,安装uview-ui后,在pages.json里配置了easycom,运行到chrome报错:Uncaught ReferenceError: uni is not defined,如果不配置easycom或去掉leftWindow页面显示正常。

2023-12-14 14:18 负责人:无 分享
已邀请:
t***@qq.com

t***@qq.com

类似问题,在left-widnow使用uview2.0的u-icon组件,报错
Uncaught ReferenceError: uni is not defined
at eval (props.js:6:22)
at Object.OQtX (index.js:3768:1)
at webpack_require (index.js:854:30)
at fn (index.js:151:20)
at eval (u-icon.vue:52:1)
at Object.XCwf (index.js:3994:1)
at
webpack_require
(index.js:854:30)
at fn (index.js:151:20)
at eval (null:1:1)
at Module.CDQf (index.js:3233:1)

钱缺缺

钱缺缺

你们怎么解决的 我是在top-windos 使用了ico 这个可以正常运行部 如果我家pinia sh


import useTestStore from "@/store/modules/test";  

const TestStore = useTestStore();
``` uni.addInterceptor('request', httpInterceptor)    前面uni未定义  
就报错了  

要回复问题请先登录注册