Skip to content

h5.router.mode使用multi模式时路由search多一个问号异常 #18255

@sunmenghua

Description

@sunmenghua

请先确认

  • 我已搜索并确定这个提交不是重复的

Taro 版本

v4

相关领域

H5 路由

使用框架

React

相关平台

  • 所有平台
  • Web 端(H5)
  • 移动端(React-Native)
  • 鸿蒙(Harmony)
  • 鸿蒙容器(Harmony Hybrid)
  • ASCF 元服务
  • 快应用(QuickApp)
  • 所有小程序
  • 微信小程序
  • 企业微信小程序
  • 京东小程序
  • 百度小程序
  • 支付宝小程序
  • 支付宝 IOT 小程序
  • 头条小程序
  • QQ 小程序
  • 钉钉小程序
  • 飞书小程序
  • 快手小程序

小程序基础库版本

No response

问题描述

配置:
h5.router.mode = multi

在页面a点击触发路由跳转:

Taro.navigateTo({
  url: `/pages/login/index?a=1,
});

唤起test页面地址异常,search部分多了一个问号:
http://localhost:3333/pages/login/index.html??a=1

bug定位:

Image Image

复现链接

复现步骤

环境信息

Taro v4.1.5

Cloud build environment variables not found, the default publicPath configuration will be used.
Current publicPath is: /

  Taro CLI 4.1.5 environment info:
    System:
      OS: macOS 15.5
      Shell: 5.9 - /bin/zsh
    Binaries:
      Node: 20.19.0 - ~/.nvm/versions/node/v20.19.0/bin/node
      Yarn: 1.22.22 - ~/.nvm/versions/node/v20.19.0/bin/yarn
      npm: 10.8.2 - ~/.nvm/versions/node/v20.19.0/bin/npm
    npmPackages:
      @tarojs/cli: ^4.1.3 => 4.1.5
      @tarojs/components: ^4.1.3 => 4.1.5
      @tarojs/helper: ^4.1.3 => 4.1.5
      @tarojs/plugin-framework-react: ^4.1.3 => 4.1.5
      @tarojs/plugin-inject: ^4.1.3 => 4.1.5
      @tarojs/plugin-mini-ci: ^4.1.3 => 4.1.5
      @tarojs/plugin-platform-h5: ^4.1.3 => 4.1.5
      @tarojs/plugin-platform-weapp: ^4.1.3 => 4.1.5
      @tarojs/react: ^4.1.3 => 4.1.5
      @tarojs/runtime: ^4.1.3 => 4.1.5
      @tarojs/shared: ^4.1.3 => 4.1.5
      @tarojs/taro: ^4.1.3 => 4.1.5
      @tarojs/vite-runner: ^4.1.3 => 4.1.5
      babel-preset-taro: ^4.1.3 => 4.1.5
      eslint-config-taro: ^4.1.3 => 4.1.5
      react: ^18.0.0 => 18.3.1

开源贡献

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-routerArea - H5 路由相关F-reactFramework - ReactT-h5Target - 编译到 H5V-4Version - 4.xbugSomething isn't working

    Type

    No type

    Projects

    Status

    Padding

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions