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

为什么不能支持vue单组件style的scoped属性呢? #14

Closed
blessbygod opened this issue Jul 29, 2016 · 3 comments
Closed

为什么不能支持vue单组件style的scoped属性呢? #14

blessbygod opened this issue Jul 29, 2016 · 3 comments
Labels

Comments

@blessbygod
Copy link

vuec 做了更细粒度的是挺好,但是还想要style级别的支持。

@ccqgithub
Copy link
Owner

scoped 要根据class去找对应的dom标签进行修改,不可控因素太多了,开发性价比不高,所以做了个简化版的~

@blessbygod
Copy link
Author

blessbygod commented Jul 30, 2016

其实用vue的这个功能就是开发及其简单,希望能给予支持。
也是shadow dom 的一个特点

@ccqgithub
Copy link
Owner

scoped的是html5的一个属性,在style上加scoped之后,该样式只对当前元素和子元素有效。

看了下vue-loader的做法是通过postcss处理,将每一个classname对于的dom加一个hash属性。。这涉及到预处理语言,import,动态组件片段等各种可能出现bug的未知问题,要处理好工作量很大。。

所以我更倾向于自己手动控制scoped css的做法。。

如果不能满足你的需求很抱歉罗,目前我没有时间和精力去处理这个,我写这个插件也主要是为了方便工作,顺便分享出来。。。

本人能力有限,如果大家有好的idea,欢迎提交pr,或者fork重新发布一个插件也可以,期待fis3有更多更好的插件出来 🐱

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

No branches or pull requests

2 participants