5***@qq.com
5***@qq.com
  • 发布:2023-06-25 20:53
  • 更新:2023-06-25 20:56
  • 阅读:182

【报Bug】pages.json在path属性配置参数报错

分类:HBuilderX

产品分类: HbuilderX

PC开发环境操作系统: Windows

PC开发环境操作系统版本号: windows10专业版

HBuilderX版本号: 3.8.4

示例代码:
{  
    "pages": [{  
            "path": "pages/chatindex/index?id=5",  
            "name": "chatindex",  
            "aliasPath": "/wxindex",  
            "requireAuth": true,  
            "style": {  
                "navigationBarTitleText": "聊天首页",  
                "navigationStyle": "custom"  
            }  
        },]

操作步骤:
{  
    "pages": [{  
            "path": "pages/chatindex/index?id=5",  
            "name": "chatindex",  
            "aliasPath": "/wxindex",  
            "requireAuth": true,  
            "style": {  
                "navigationBarTitleText": "聊天首页",  
                "navigationStyle": "custom"  
            }  
        },]

预期结果:

打包后路径应为"/pages/chatindex/index.vue?id=5"

实际结果:

"/pages/chatindex/index.vue?id=5.vue"

bug描述:

在pages.json中给path配置参数,运行后报错Missing initializer in const declaration
检查发现是打包后id后面又自动拼接了.vue,详情见附件图

代码如下

{  
    "pages": [{  
            "path": "pages/chatindex/index?id=5",  
            "name": "chatindex",  
            "aliasPath": "/wxindex",  
            "requireAuth": true,  
            "style": {  
                "navigationBarTitleText": "聊天首页",  
                "navigationStyle": "custom"  
            }  
        },]
2023-06-25 20:53 负责人:无 分享
已邀请:
昭昭L

昭昭L - 开心就好

为啥要这么配,既然id=5是个写死的值,为什么不在页面里给变量设个初始值=5?页面路径可能不支持这种写法

要回复问题请先登录注册