Taro: [taro-2.0.0]升级2.0后,部分页面样式失效

Created on 9 Jan 2020  ·  6Comments  ·  Source: NervJS/taro

问题描述

Taro 升级2.0后,部分页面样式失效
image

复现步骤

  1. 登录小程序
  2. 点击“数据库”
  3. 进入“订单”列表即可看到样式不起作用的情况

期望行为

样式恢复正常作用

报错信息

image

系统信息

image

question

Most helpful comment

应该是公共样式都被编译到了 vendors.wxss 里了,vendors.wxss 会被 app.wxss 引用,但是组件默认不受 app.wxss 影响,解决办法可以是,给组件添加addGlobalClass` 配置,https://nervjs.github.io/taro/docs/component-style.html#%E5%85%A8%E5%B1%80%E6%A0%B7%E5%BC%8F%E7%B1%BB

All 6 comments

CC @Chen-jj

欢迎提交 Issue~

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

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

Good luck and happy coding~

具体项目代码可联系本人,麻烦了!🙏🙏🙏

这个我也遇到了,我重命名样式文件,然后就可以编译了,具体原因未知,暂时解决了问题

应该是公共样式都被编译到了 vendors.wxss 里了,vendors.wxss 会被 app.wxss 引用,但是组件默认不受 app.wxss 影响,解决办法可以是,给组件添加addGlobalClass` 配置,https://nervjs.github.io/taro/docs/component-style.html#%E5%85%A8%E5%B1%80%E6%A0%B7%E5%BC%8F%E7%B1%BB

应该是公共样式都被编译到了 vendors.wxss 里了,vendors.wxss 会被 app.wxss 引用,但是组件默认不受 app.wxss 影响,解决办法可以是,给组件添加addGlobalClass` 配置,https://nervjs.github.io/taro/docs/component-style.html#%E5%85%A8%E5%B1%80%E6%A0%B7%E5%BC%8F%E7%B1%BB

确实如此,问题已解决。

Was this page helpful?
0 / 5 - 0 ratings