npm install stylus --save
npm install stylus-loader --save
<style lang="stylus" scoped>
@import '~styles/comm.styl'
.header
background $bgColor
</style>
~styles/comm.styl
$bgColor = #00bcd4
本文介绍如何使用npm安装并保存Stylus及其加载器,演示了在项目中通过导入公共样式文件来应用Stylus样式的方法。具体展示了如何在style标签中使用lang属性指定Stylus语言,并通过@import语句引入外部样式文件。
npm install stylus --save
npm install stylus-loader --save
<style lang="stylus" scoped>
@import '~styles/comm.styl'
.header
background $bgColor
</style>
~styles/comm.styl
$bgColor = #00bcd4

被折叠的 条评论
为什么被折叠?