优点: 提高代码可维护性,比如改变整个页面的主题颜色。
使用方法: 在styls文件夹下创建 varibles.styl文件
$bgColor = #00bcd4
$headerHeight = .5rem
在组件中引入,然后直接使用变量名即可
@import '~@/assets/styles/varibles.styl'
.header
height $headerHeight
background $bgColor
注意引入样式要在路径前面加波浪线
优点: 提高代码可维护性,比如改变整个页面的主题颜色。
使用方法: 在styls文件夹下创建 varibles.styl文件
$bgColor = #00bcd4
$headerHeight = .5rem
在组件中引入,然后直接使用变量名即可
@import '~@/assets/styles/varibles.styl'
.header
height $headerHeight
background $bgColor
注意引入样式要在路径前面加波浪线