uni.setNavigationBarTitle( {
title: '标题',
complete() {}
} )
- 发布:2025-11-10 17:55
- 更新:2025-11-12 17:47
- 阅读:118
产品分类: uniapp/小程序/微信
PC开发环境操作系统: Windows
PC开发环境操作系统版本号: Windows 11 专业工作站版26H1
HBuilderX类型: 正式
HBuilderX版本号: 4.85
第三方开发者工具版本号: 2.01.2510241 win32-x64
基础库版本号: 3.11.0
项目创建方式: HBuilderX
操作步骤:
预期结果:
无报错
无报错
实际结果:
TypeError: Cannot read property '0' of undefined
at vendor.js?t=wechat&s=1762766333795&v=79ad6db71d54a75e70f2b4b787cffbda:28031(env: Windows,mp,2.01.2510241; lib: 3.11.0)
报错
TypeError: Cannot read property '0' of undefined
at vendor.js?t=wechat&s=1762766333795&v=79ad6db71d54a75e70f2b4b787cffbda:28031(env: Windows,mp,2.01.2510241; lib: 3.11.0)
报错
bug描述:
uni.setNavigationBarTitle( {
title: '标题',
complete() {}
} )
百分百复现,已经存在好几个版本了
如果使用wx.setNavigationBarTitle( {
title: '标题',
complete() {}
} )
是正常的,和微信开发人员确认了说这uni的问题
TypeError: Cannot read property '0' of undefined
at vendor.js?t=wechat&s=1762766333795&v=79ad6db71d54a75e70f2b4b787cffbda:28031(env: Windows,mp,2.01.2510241; lib: 3.11.0)
最佳回复
根目录的 uni.promisify.adaptor.js 替换为下面的代码
uni.addInterceptor({
returnValue (res) {
if (!(!!res && (typeof res === "object" || typeof res === "function") && typeof res.then === "function")) {
return res;
}
return new Promise((resolve, reject) => {
res.then((res) => {
if (!res) {
return resolve(res)
}
return res[0] ? reject(res[0]) : resolve(res[1])
});
});
},
}); 名帝 (作者) - I want to play a game with you.
空页面也出现的
-
-
-
名帝 (作者)
回复 DCloud_UNI_JBB: 无法上传提示/publish/ajax/attach_upload/id-answer__attach_access_key-3031339494a498cceb27531a8b8e4b7c?qqfile=my-project2.zip:1
Failed to load resource: net::ERR_HTTP2_PROTOCOL_ERROR2025-11-12 16:08
-
-
名帝 (作者) - I want to play a game with you.
刚刚又测试了一下,使用原生无当前问题,但是用脚手架就出现
vue create -p dcloudio/uni-preset-vue my-project
安装运行小程序就直接复现
名帝 (作者) - I want to play a game with you.
官方文档流程新建的dome
vue create -p dcloudio/uni-preset-vue my-project

