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

微信小程序路由页面内hooks 配置 config 的window 背景,不生效, 编译后在开发者工具里显示页面的window 无效 #5103

Closed
anryzhang opened this issue Dec 17, 2019 · 4 comments
Assignees
Labels
question Further information is requested

Comments

@anryzhang
Copy link

问题描述

微信小程序路由页面内hooks 配置 config 的window 背景,不生效,
编译后在开发者工具里显示页面的window 无效警告,但实际编译后的json文件里,
window 是有的。

复现步骤

  1. 在一个Hooks组件路由页面下自定义当前页面config.
  2. 在config 对象里定义窗口背景
    3.编译后,在微信小程序开发者工具里,不显示改过的背景颜色 ,且报无效的 window。
hooks 组件页面配置代码:

Detail.config = {
  "window": {
    backgroundColor: '#79cc26',
    enablePullDownRefresh: true
  }
}

期望行为

正确显示当前hooks 配置

报错信息

开发者工具报错如下:
VM3255:1 无效的 pageJSON(pages/detail/detail)["window"]

系统信息

Taro CLI 1.3.29 environment info:
System:
OS: macOS 10.15.1
Shell: 5.7.1 - /bin/zsh
Binaries:
Node: 10.16.0 - /usr/local/bin/node
Yarn: 1.19.1 - /usr/local/bin/yarn
npm: 6.13.2 - /usr/local/bin/npm

@taro-bot
Copy link

taro-bot bot commented Dec 17, 2019

CC @Chen-jj

@taro-bot
Copy link

taro-bot bot commented Dec 17, 2019

欢迎提交 Issue~

如果你提交的是 bug 报告,请务必遵循 Issue 模板的规范,尽量用简洁的语言描述你的问题,最好能提供一个稳定简单的复现。🙏🙏🙏

如果你的信息提供过于模糊或不足,或者已经其他 issue 已经存在相关内容,你的 issue 有可能会被关闭。

Good luck and happy coding~

@ThoughtZer
Copy link

ThoughtZer commented Dec 17, 2019

@anryzhang window 需要吗?不是直接配置的吗
Detail.config = { backgroundColor: '#79cc26', enablePullDownRefresh: true }

@Chen-jj
Copy link
Contributor

Chen-jj commented Dec 17, 2019

@anryzhang 你把全局配置和页面配置混了,再看看微信小程序文档怎么配置吧。 @ThoughtZer 正解。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants