今天做微信小程序,在组件引用过程中出现了样式错乱,在没引用之前都是好好的。
只见有这样的警告:
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
版本设置如下:
第一步:
如:

这样就正常了