vue 如何在js中调用scss的变量名
第一步在scss文件中写上:$theme-text-color-colorful:#EE5002; //这是一个变量名//主要的一步::export {theme_color: $theme-text-color-colorful;}第二步在要用到变量的js中import styles from 'scss文件路径名';第三步假设在data中data(){...
·
第一步在scss文件中写上:
$theme-text-color-colorful:#EE5002; //这是一个变量名
//主要的一步:
:export {
theme_color: $theme-text-color-colorful;
}
第二步在要用到变量的js中
import styles from 'scss文件路径名';
第三步假设在data中
data(){
return{
textColor:styles.theme_color
}
}
最后调用这个textColor就可以了
更多推荐



所有评论(0)