-
Notifications
You must be signed in to change notification settings - Fork 43
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
css隔离 #10
Comments
要想解决这个问题,只能遍历 css 的 ast,然后把 css 类名给重命名一遍了 svelte 中做了这个工作,可我咋感觉工作量比较大 https://www.github.com/sveltejs/svelte/tree/master/src%2Fcompiler%2Fcompile%2Fcss%2FSelector.ts vue 是咋做的 |
使用 vue 的方案 https://github.com/vuejs/vue-loader/blob/v14.2.2/lib/style-compiler/plugins/scope-id.js input <style>
.example{
color:red;
}
</style>
<div>scoped</div> output <style>
.example[data-scoped-5558831a] {
color: red;
}
</style>
<div class="example" data-scoped-5558831a>scoped</div> |
暂时搞定了 class 级别的 #12 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
打包后,子组件的样式会影响到父组件,目前没有做一个很好的css隔离。
The text was updated successfully, but these errors were encountered: