当前位置: 首页 > Web前端 > CSS

sass如何改变皮肤

时间:2023-03-30 14:40:42 CSS

/*主题颜色*/$color-primary-green:green;/*改变颜色*/$color-primary-blue:blue;/*改变颜色*/$data-default:"green"@mixincolor_primary(){&[data-txt="green"]{背景:$color-primary-green;}&[data-txt="blue"]{背景:$color-primary-blue;}}.price{高度:400px;/*color:$color-primary;*//*原始参考方法,错误*/&::before{content:attr(data-txt);}@includecolor_primary();/*使用函数调用*/}import{Vue,Component,Prop,Watch,Emit}from'vue-property-decorator'import{mixins}from'vue-class-component'bgColor:string="blue";privatechangeSkin(){//this.$refs.bgDom.attributes('data-txt','green');this.bgColor=this.bgColor=="蓝色"?“绿,蓝”;}参考地址git项目地址。详细解释