feat:addline color 去除clear 和 click按钮

This commit is contained in:
zhangyu
2020-08-24 13:40:08 +08:00
parent 8230651b5e
commit 11e20ead4a
2 changed files with 17 additions and 0 deletions

View File

@@ -2015,3 +2015,7 @@ li{
}
}
}
.el-color-dropdown .el-button--mini{
display: none !important;
}

View File

@@ -65,6 +65,7 @@
v-model="form.color"
:predefine="predefineColors"
ref="colorPicker"
@active-change="colorChange"
>
</el-color-picker>
</div>
@@ -166,6 +167,18 @@
colorPickerClick(){
this.$refs['colorPicker'].showPicker=true;
},
colorChange(val){
this.form.color=this.colorRGBtoHex(val)
},
colorRGBtoHex(color) {
let rgb = color.split(',');
let r = parseInt(rgb[0].split('(')[1]);
let g = parseInt(rgb[1]);
let b = parseInt(rgb[2].split(')')[0]);
let hex = "#" + ((1 << 24) + (r << 16) + (g << 8) + b).toString(16).slice(1);
return hex;
}
},
}