vue-cli3.0 給每個(gè).vue文件的css stylus設(shè)置全局變量

// vue.config.js 文件

module.exports = {
css: {
loaderOptions: {
// 給 stylus-loader 傳遞選項(xiàng)
stylus: {
// @/ 是 src/ 的別名
// 所以這里假設(shè)你有 src/common/stylus/color.styl 這個(gè)文件,需要在沒有vue文件中import
import: '~@/common/stylus/color.styl'
}
}
}
}
// .vue文件的 會(huì)在loader后在 <style lang="stylus"> 頭部插入import src/common/stylus/color.styl
// 缺少loader直接npm安裝到開發(fā)環(huán)境就可以了

在網(wǎng)上找了好久,才找到這篇文章,在vue-cli3.0 給每個(gè).vue文件的css stylus設(shè)置全局變量。
原文鏈接:https://blog.csdn.net/guang_sszbs/java/article/details/90411728

?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

友情鏈接更多精彩內(nèi)容