今天做微信小程序,在组件引用过程中出现了样式错乱,在没引用之前都是好好的。

只见有这样的警告:

Some selectors are not allowed in component wxss, including tag name selectors, ID selectors, and attribute selectors.

找了好久,百度了一圈,最终还是看官方文档吧,原来是版本太低了,建议设置高版本就可以了。

https://developers.weixin.qq.com/miniprogram/dev/framework/custom-component/wxml-wxss.html

版本设置如下:

第一步:

如:

微信小程序样式错乱
标题

这样就正常了

 

 

 

 

 

 

 

Logo

北京人形旗下天工造物具身智能开源社区,聚焦具身天工与慧思开物两大平台

更多推荐