From 46de17edcbf64290e62abc60247cfea9ce81e6ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=B1=E7=9C=A0=E5=84=80=E5=BC=8F?= <854085467@qq.com> Date: Sat, 30 Apr 2022 04:34:48 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B:=20=E4=BF=AE=E5=A4=8D=20slider=20?= =?UTF-8?q?=E7=BB=84=E4=BB=B6=E7=BC=BA=E5=B0=91=20name=20=E5=B1=9E?= =?UTF-8?q?=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/component/colorPicker/EyeDropper.vue | 61 +++++++++++++------ .../src/component/colorPicker/index.vue | 23 +++---- .../component/src/component/scroll/index.vue | 7 ++- .../src/component/slider/Standard.vue | 1 + .../src/component/slider/StandardRange.vue | 2 + .../src/component/slider/Vertical.vue | 1 + .../src/component/slider/VerticalRange.vue | 1 + .../component/src/component/slider/index.vue | 8 ++- .../src/component/slider/sliderVerify.vue | 1 + 9 files changed, 70 insertions(+), 35 deletions(-) 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 @@ +