--- pages.json
{
"pages": [{
"path": "pages/a",
"style": {
"navigationBarTitleText": "a"
}
},
{
"path": "pages/b",
"style": {
"navigationBarTitleText": "b"
}
}
],
"globalStyle": {
"navigationBarTextStyle": "black",
"navigationBarTitleText": "d",
"navigationBarBackgroundColor": "#f1f2f6",
"backgroundColor": "#F8F8F8"
},
"uniIdRouter": {}
}
修改代码热更新后,b页面的navigationBarTitleText显示为d
查看小程序生成的 b.json,navigationBarTitleText会丢失,a.json则不会
--- a.json
{
”navigationBarTitleText“:"a",
"usingComponents": {}
}
--- b.json, b应该是页面,现在变成了组件 "component": true
{
"component": true,
"usingComponents": {}
}
![ICanHelp](https://img-cdn-tc.dcloud.net.cn/account/identicon/1ae46d58f2dd546cbd9d9d8b628cd8ca.png)
- 发布:2022-08-16 09:41
- 更新:2022-08-16 10:14
- 阅读:237
产品分类: uniapp/小程序/微信
PC开发环境操作系统: Windows
PC开发环境操作系统版本号: Windows 功能体验包 1000.22000.778.0
HBuilderX类型: 正式
HBuilderX版本号: 3.5.4
第三方开发者工具版本号: 1.06.2206020
基础库版本号: 2.24.6
项目创建方式: HBuilderX
示例代码:
操作步骤:
修改b.vue文件使其热更新
修改b.vue文件使其热更新
预期结果:
--- b.json 文件
{
”navigationBarTitleText“:"b",
"usingComponents": {}
}
--- b.json 文件
{
”navigationBarTitleText“:"b",
"usingComponents": {}
}
实际结果:
--- b.json 文件, b应该是页面,现在变成了组件 "component": true
{
"component": true,
"usingComponents": {}
}
--- b.json 文件, b应该是页面,现在变成了组件 "component": true
{
"component": true,
"usingComponents": {}
}
bug描述:
热更新后,页面变成了组件
2 个回复
ICanHelp (作者)
pages/a/a,pages/b/b则不会有这种问题,也就是加多一层目录
ICanHelp (作者)
热启动后,多出几个文件,内容是
{
"component": true,
"usingComponents": {}
}
这是为什么页面变成组件的原因