The problem of css scope in vue

css file mode import". / index.less"
is introduced into vue. After being packaged in this way, all css are global styles. Is there any way to solve this problem?
if style tags are officially recommended to add scope, css encounters a problem that css cannot extract separately

Mar.12,2021

"it is officially recommended to add scope, to the style tag, so css encounters a problem that css cannot extract alone"? What are you talking about?


can be extracted normally, and there is no problem

Project creates
clipboard.png

via the latest vue-cli
<style lang="less" src="./index.less" scoped></style>

or

<style lang="less" scoped>
@import './index.less';
</style>
Menu