如果使得下面写法生效
bem写法
<template>
<div class="ga-home__container">
...
</div>
</template>
<style>
@component-namespace ga {
@b home {
@e container {
width: 100%;
height: 100%;
color: #a2eeff;
}
}
}
</style>
使用postcss-salad
配置后,需要可以渲染成功,但会报错:
postcss-custom-properties: variable '--bg-color' is undefined and used without a fallback
然后,再引入插件postcss-import
与postcss-cssnext
,但还是不行,而且会导致项目运行变得比较卡;
如下遇到的报错问题【与上面没关联】:
Module build failed (from ./node_modules/postcss-loader/dist/cjs.js):
Error: true is not a PostCSS plugin
Module build failed (from ./node_modules/postcss-loader/src/index.js):
TypeError: child.moveAfter is not a function
Module build failed (from ./node_modules/postcss-loader/index.js):
TypeError: Cannot read property 'postcss' of undefined
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…