diff --git a/package/component/src/component/colorPicker/EyeDropper.vue b/package/component/src/component/colorPicker/EyeDropper.vue index e6e8c976..c1628d66 100644 --- a/package/component/src/component/colorPicker/EyeDropper.vue +++ b/package/component/src/component/colorPicker/EyeDropper.vue @@ -1,22 +1,43 @@ \ No newline at end of file + diff --git a/package/component/src/component/colorPicker/index.vue b/package/component/src/component/colorPicker/index.vue index 77398788..47884fd4 100644 --- a/package/component/src/component/colorPicker/index.vue +++ b/package/component/src/component/colorPicker/index.vue @@ -8,8 +8,8 @@ export default { import "./index.less"; import LayDropdown from "../dropdown/index.vue"; import EyeDropper from "./EyeDropper.vue"; -import { ref, computed, watch, onMounted, } from "vue"; -import { useEyeDropper } from '@vueuse/core' +import { ref, computed, watch, onMounted } from "vue"; +import { useEyeDropper } from "@vueuse/core"; const emit = defineEmits(["update:modelValue"]); @@ -27,7 +27,7 @@ const props = withDefaults(defineProps(), { const saturationValue = ref(null); const hueSlider = ref(null); const alphaSlider = ref(null); -const { isSupported, open, sRGBHex } = useEyeDropper() +const { isSupported, open, sRGBHex } = useEyeDropper(); let pointStyle = ref("top: 25%;left: 80%;"); let hueSliderStyle = ref("left: 0;"); @@ -42,13 +42,13 @@ let green = ref(0); let blue = ref(0); let alpha = ref(1); -const openEyeDropper = function(){ - if(isSupported){ +const openEyeDropper = function () { + if (isSupported) { open(); - }else{ + } else { console.warn("LayColorPicker: Eye dropper not supported by your browser!"); } -} +}; onMounted(() => { let { r, g, b, a } = parseColor(props.modelValue); @@ -64,7 +64,7 @@ watch(sRGBHex, (sRGBHex) => { green.value = g; blue.value = b; alpha.value = a; -}) +}); watch([red, green, blue], (newValue) => { emit( @@ -450,10 +450,11 @@ function hex2rgba(s: any) { > -
+ @click="openEyeDropper" + style="margin-left: 5px" + >
diff --git a/package/component/src/component/scroll/index.vue b/package/component/src/component/scroll/index.vue index dc51e75a..f322db4b 100644 --- a/package/component/src/component/scroll/index.vue +++ b/package/component/src/component/scroll/index.vue @@ -24,7 +24,8 @@ height: data.barHeight + 'px', width: scrollWidth + 'px', transform: 'translateY(' + data.translateY + 'px)', - backgroundColor: data.heightPre == 1 ? 'rgba(0,0,0,0)' : scrollColor, + backgroundColor: + data.heightPre == 1 ? 'rgba(0,0,0,0)' : scrollColor, }" class="layui-scroll-thumb" @mousedown.stop.prevent="moveStart" @@ -36,8 +37,8 @@ +