|
@@ -1,5 +1,5 @@
|
|
|
<template>
|
|
<template>
|
|
|
- <div class="color-picker">
|
|
|
|
|
|
|
+ <div class="color-picker" :style="{ width: `${width}px` }">
|
|
|
<color-picker v-model="sValue" :position="positionCom" @change="onChange" />
|
|
<color-picker v-model="sValue" :position="positionCom" @change="onChange" />
|
|
|
<!-- <div class="color-btn"></div>
|
|
<!-- <div class="color-btn"></div>
|
|
|
<div class="picker-box">
|
|
<div class="picker-box">
|
|
@@ -25,6 +25,8 @@ export default {
|
|
|
props: {
|
|
props: {
|
|
|
// v-model 当前颜色值 hex srgb
|
|
// v-model 当前颜色值 hex srgb
|
|
|
value: PropTypes.string.def(''),
|
|
value: PropTypes.string.def(''),
|
|
|
|
|
+ // 选择器宽度
|
|
|
|
|
+ width: PropTypes.integer.def(60),
|
|
|
// 显示位置 right left
|
|
// 显示位置 right left
|
|
|
horizontal: PropTypes.string.def('right'),
|
|
horizontal: PropTypes.string.def('right'),
|
|
|
},
|
|
},
|
|
@@ -71,14 +73,16 @@ export default {
|
|
|
background-color: #ffffff;
|
|
background-color: #ffffff;
|
|
|
border: 1px solid #efefef;
|
|
border: 1px solid #efefef;
|
|
|
padding: 5px;
|
|
padding: 5px;
|
|
|
- width: 60px;
|
|
|
|
|
|
|
+ width: 32px;
|
|
|
height: 32px;
|
|
height: 32px;
|
|
|
position: relative;
|
|
position: relative;
|
|
|
}
|
|
}
|
|
|
/deep/.one-colorpicker {
|
|
/deep/.one-colorpicker {
|
|
|
|
|
+ width: 100%;
|
|
|
|
|
+ height: 100%;
|
|
|
.color-block {
|
|
.color-block {
|
|
|
- width: 48px;
|
|
|
|
|
- height: 20px;
|
|
|
|
|
|
|
+ width: 100%;
|
|
|
|
|
+ height: 100%;
|
|
|
border: 1px solid #000;
|
|
border: 1px solid #000;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|