From c0cf96a4b57c58f3b5282b306635ff88b0d62d2e Mon Sep 17 00:00:00 2001 From: pipipi-pikachu <1171051090@qq.com> Date: Wed, 27 Jan 2021 21:26:41 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=BB=E9=A2=98=E9=85=8D=E7=BD=AE=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/ColorPicker/Alpha.vue | 2 +- src/components/ColorPicker/EditableInput.vue | 2 +- src/components/ColorPicker/Hue.vue | 2 +- src/components/ColorPicker/Saturation.vue | 2 +- src/components/ColorPicker/index.vue | 8 +- src/configs/element.ts | 56 ----------- src/configs/theme.ts | 2 +- src/hooks/useCreateElement.ts | 58 ++++++++---- src/mocks/index.ts | 1 + src/types/slides.ts | 2 +- src/views/Editor/Canvas/EditableElement.vue | 11 ++- .../ChartStylePanel/index.vue | 94 +++---------------- src/views/Editor/Toolbar/SlideStylePanel.vue | 29 +++++- src/views/Screen/ScreenElement.vue | 3 + .../ThumbnailSlide/ThumbnailElement.vue | 11 ++- .../element/ChartElement/BaseChartElement.vue | 11 +-- .../components/element/ChartElement/Chart.vue | 37 +++++--- .../ChartElement/ScreenChartElement.vue | 2 +- .../components/element/ChartElement/index.vue | 2 +- 19 files changed, 144 insertions(+), 191 deletions(-) diff --git a/src/components/ColorPicker/Alpha.vue b/src/components/ColorPicker/Alpha.vue index f3e372df..7c82eea6 100644 --- a/src/components/ColorPicker/Alpha.vue +++ b/src/components/ColorPicker/Alpha.vue @@ -54,7 +54,7 @@ export default defineComponent({ else a = Math.round(left * 100 / containerWidth) / 100 if(color.value.a !== a) { - emit('change', { + emit('colorChange', { r: color.value.r, g: color.value.g, b: color.value.b, diff --git a/src/components/ColorPicker/EditableInput.vue b/src/components/ColorPicker/EditableInput.vue index 60c8a849..ce2dfc20 100644 --- a/src/components/ColorPicker/EditableInput.vue +++ b/src/components/ColorPicker/EditableInput.vue @@ -30,7 +30,7 @@ export default defineComponent({ const handleInput = (e: InputEvent) => { const value = (e.target as HTMLInputElement).value - if(value.length >= 6) emit('change', tinycolor(value).toRgb()) + if(value.length >= 6) emit('colorChange', tinycolor(value).toRgb()) } return { diff --git a/src/components/ColorPicker/Hue.vue b/src/components/ColorPicker/Hue.vue index 6b81139c..a185eb6a 100644 --- a/src/components/ColorPicker/Hue.vue +++ b/src/components/ColorPicker/Hue.vue @@ -71,7 +71,7 @@ export default defineComponent({ h = (360 * percent / 100) } if(color.value.h !== h) { - emit('change', { + emit('colorChange', { h, l: color.value.l, s: color.value.s, diff --git a/src/components/ColorPicker/Saturation.vue b/src/components/ColorPicker/Saturation.vue index 5bd61b54..e338f294 100644 --- a/src/components/ColorPicker/Saturation.vue +++ b/src/components/ColorPicker/Saturation.vue @@ -48,7 +48,7 @@ export default defineComponent({ const pointerLeft = computed(() => color.value.s * 100 + '%') const emitChangeEvent = throttle(function(param) { - emit('change', param) + emit('colorChange', param) }, 20, { leading: true, trailing: false }) const saturationRef = ref() diff --git a/src/components/ColorPicker/index.vue b/src/components/ColorPicker/index.vue index ce854916..4d589c18 100644 --- a/src/components/ColorPicker/index.vue +++ b/src/components/ColorPicker/index.vue @@ -1,7 +1,7 @@