自定义组价内不允许使用标签选择器的疑问?

小程序 文章 2020-08-14 18:01 635 0 全屏看文

AI助手支持GPT4.0

自定义组价内不允许使用标签选择器的疑问?Questions about tag selectors not allowed in custom set prices?

自定义组价内不允许使用标签选择器的疑问?

在自定义组件component时使用标签选择器时,出现了这样的警告

首先声明,在自定义组件内我大部分都可以每个组件都使用class类选择器。

但是某些组件我在app.wxss里重置统一了样式,比如button以及一些写好的组件,例如下面这种,为的就是方便,这些都是很早以前写的了,这次来更新小程序时发现出现了这些新的警告,想知道这个警告以后会不会直接算是错误?毕竟如果影响运行的话改动的地方还是挺多的。如果这个就一直是警告的话,老代码我就不改了,新代码尽量避免使用吧

When using the tag selector when customizing component component, such a warning appears. First of all, I can use class class selector for most components in the custom component. But some of the components I have app.wxss Reset the unified style, such as button and some written components, such as the following one, for convenience. These are written a long time ago. When I update the applet this time, I found these new warnings. Would you like to know whether this warning will be regarded as an error in the future? After all, if the operation is affected, there are still many changes. If this is always a warning, I will not change the old code, and try to avoid using the new code

回答:

畅移:

可忽略吧,开发者工具降级就不会出现,目前这里应该是 shadow DOM 样式隔离,兼容还没有做好吧!


拾忆:

自定义组件 使用 css 选择器 :标签名选择器、id选择器、属性选择器 ,都会有黄色警告

https://developers.weixin.qq.com/miniprogram/dev/framework/quickstartelease.html

stop eating:

没说自定义组件,自定义组件是 custom component

微喵网络:

尽量改吧,鬼知道以后会不会变成错误

-EOF-

AI助手支持GPT4.0