module.exports = {
module: {
rules: [
{
test: /.less$/,
use: ['vue-style-loader', 'css-loader', 'less-loader'],
},
],
}
}
<template>
<div class="blog-header">Header</div>
</template>
<script>
export default {
setup() {
return {};
},
};
</script>
<style lang="less">
.blog-header {
border-top: 5px solid #ccc;
color: red;
}
</style>
实际渲染效果
问题:如何让样式生效?
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…