亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定

styl樣式文件問題:vue重復加載

錯誤代碼:

ERROR in ./node_modules/[email protected]@css-loader!./node_modules/[email protected]@postcss-loader/lib??ref--9-2!./node_modules/[email protected]@stylus-loader!./node_modules/[email protected]@style-loader!./node_modules/[email protected]@css-loader!./node_modules/[email protected]@postcss-loader/lib??ref--10-2!./node_modules/[email protected]@stylus-loader!./src/assets/styles/footer.styl

Module build failed: ParseError: G:\前端學習\vue-start\test\src\assets\styles\footer.styl:2:253

? ?1|

? ?2| var content = require("!!../../../node_modules/[email protected]@css-loader/index.js!../../../node_modules/[email protected]@postcss-loader/lib/index.js??ref--10-2!../../../node_modules/[email protected]@stylus-loader/index.js!./footer.styl");

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------^

? ?3|

? ?4| if(typeof content === 'string') content = [[module.id, content, '']];

? ?5|


expected "indent", got ";"

在StackOverflow上找到類似問題,原因是.styl文件引入過程中,webpack打包stylus-loader->postcss->css->style,打包完后,vue自身又會在自動打包一次也就是stylus-loader->postcss->css->style => stylus ->postcss -> css

解決辦法是:不通過require和import引入.styl文件,通過<style>標簽引入

但是老師的footer.jsx 是用jsx寫的,好像不能用<script>,很無奈,各位大神有什么其他的解決辦法嗎?很崩潰,搞了一晚上了

正在回答

1 回答

http://img1.sycdn.imooc.com//5d92251f00014b5605870451.jpg

對了一下老師github上的代碼,發現是這個多余了,剛填坑

0 回復 有任何疑惑可以回復我~

舉報

0/150
提交
取消

styl樣式文件問題:vue重復加載

我要回答 關注問題
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號