Przeglądaj źródła

refactor: remove the throttling function and update the color value directly

nian 1 miesiąc temu
rodzic
commit
96f8447a86

+ 1 - 6
src/layout/header/actions/component/PreferencesDrawer.vue

@@ -1,5 +1,4 @@
 <script setup lang="ts">
-import { throttle } from 'lodash-es'
 import {
   NColorPicker,
   NDivider,
@@ -53,10 +52,6 @@ const colorSwatches = [
   twColors.pink[500],
 ]
 
-const modifyColor = throttle((value: string) => {
-  setColor(value)
-}, 1000)
-
 const showWatermarkModal = () => {
   modal.create({
     title: '修改水印信息',
@@ -129,7 +124,7 @@ const showNoiseModal = () => {
               v-bind="$attrs"
               :default-value="color"
               :swatches="colorSwatches"
-              @update-value="(value) => modifyColor(value)"
+              @update-value="setColor"
             />
           </div>
           <div>