We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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隔离。
The text was updated successfully, but these errors were encountered:
要想解决这个问题,只能遍历 css 的 ast,然后把 css 类名给重命名一遍了
svelte 中做了这个工作,可我咋感觉工作量比较大
https://www.github.com/sveltejs/svelte/tree/master/src%2Fcompiler%2Fcompile%2Fcss%2FSelector.ts
vue 是咋做的
Sorry, something went wrong.
使用 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
No branches or pull requests
打包后,子组件的样式会影响到父组件,目前没有做一个很好的css隔离。
The text was updated successfully, but these errors were encountered: