Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

目标页面设置PageMeta属性,跳转时属性设置失效 #15346

Closed
json-q opened this issue Mar 13, 2024 · 1 comment · Fixed by #15350 or #15496
Closed

目标页面设置PageMeta属性,跳转时属性设置失效 #15346

json-q opened this issue Mar 13, 2024 · 1 comment · Fixed by #15350 or #15496
Labels
F-react Framework - React T-weapp Target - 编译到微信小程序 V-3 Version - 3.x

Comments

@json-q
Copy link

json-q commented Mar 13, 2024

相关平台

微信小程序

小程序基础库: 3.3.4
使用框架: React

复现步骤

主包分包页面都设置了 PageMeta,主包中的页面跳转进入分包页面,属性不生效。

用开发工具设置当前分包页面为启动页面时,PageMeta 的属性可以生效,普通跳转进入的方式属性是设置不上去的。

代码很简单就可以复现:

// 主包页面,字体正常,PageMeta 属性可以设置
   <>
      <PageMeta rootFontSize='30px' />
      <Navigator url='/pages/sub/index'>跳转 sub 分包页面</Navigator>
    </>

// 分包页面,由链接跳转过来,PageMeta 设置的属性丢失
    <>
      <PageMeta rootFontSize='30px' />
      <View>SubPage</View>
    </>

期望结果

分包页面中的属性能够设置上

实际结果

分包中的属性,例如 rootFontSize、pageFontSize 等都未生效,标签元素内不存在这些属性

image

环境信息

👽 Taro v3.6.23


  Taro CLI 3.6.23 environment info:
    System:
      OS: Windows 11 10.0.22621
    Binaries:
      Node: 20.8.1 - D:\Node\node.EXE
      Yarn: 1.22.19 - ~\AppData\Roaming\npm\yarn.CMD
      npm: 10.1.0 - D:\Node\npm.CMD
    npmPackages:
      @tarojs/cli: 3.6.23 => 3.6.23 
      @tarojs/components: 3.6.23 => 3.6.23 
      @tarojs/helper: 3.6.23 => 3.6.23 
      @tarojs/plugin-framework-react: 3.6.23 => 3.6.23 
      @tarojs/plugin-platform-alipay: 3.6.23 => 3.6.23 
      @tarojs/plugin-platform-h5: 3.6.23 => 3.6.23 
      @tarojs/plugin-platform-jd: 3.6.23 => 3.6.23
      @tarojs/plugin-platform-qq: 3.6.23 => 3.6.23
      @tarojs/plugin-platform-swan: 3.6.23 => 3.6.23
      @tarojs/plugin-platform-tt: 3.6.23 => 3.6.23
      @tarojs/plugin-platform-weapp: 3.6.23 => 3.6.23
      @tarojs/react: 3.6.23 => 3.6.23
      @tarojs/runtime: 3.6.23 => 3.6.23
      @tarojs/shared: 3.6.23 => 3.6.23
      @tarojs/taro: 3.6.23 => 3.6.23
      @tarojs/taro-loader: 3.6.23 => 3.6.23
      @tarojs/webpack5-runner: 3.6.23 => 3.6.23
      babel-preset-taro: 3.6.23 => 3.6.23
      eslint-config-taro: 3.6.23 => 3.6.23
      react: ^18.0.0 => 18.2.0
@taro-bot2 taro-bot2 bot added F-react Framework - React T-weapp Target - 编译到微信小程序 V-3 Version - 3.x labels Mar 13, 2024
@json-q
Copy link
Author

json-q commented Mar 13, 2024

又测试了一下,跟分包没关系,只要是跳转的目标页面设置了PageMeta就不行,属性不生效

@json-q json-q changed the title 分包页面PageMeta属性设置失效 目标页面设置PageMeta属性,跳转时属性设置失效 Mar 13, 2024
TheKonka added a commit to TheKonka/taro that referenced this issue Mar 13, 2024
luckyadam added a commit that referenced this issue Mar 25, 2024
* fix: fix set pagemeta when there are multiple pages

#15346

* test: update snapshot

---------

Co-authored-by: Li,Weitao <weitaozsh@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
F-react Framework - React T-weapp Target - 编译到微信小程序 V-3 Version - 3.x
Projects
Archived in project
1 participant