安装stylus
在项目文件夹中打开git bash,然后在黑框中输入npm install stylus stylus-loader。
在项目中创建 stylus 文件
在css文件夹下创建stylus文件,格式为 文件名.styl ,然后在文件上写代码。
在vue组件中引入stylus文件
如上图,在style标签里面输入 lang=“stylus”。因为是在style标签下引入文件,所以要使用 @import ’ 路径 ’ 这方法来引入,其中~@指代的是src。
来源:CSDN
作者:weixin_39559640
链接:https://blog.csdn.net/weixin_39559640/article/details/100712205