浏览代码

ColorPicker: fix the position of cursor (#12376)

why 7 年之前
父节点
当前提交
3d3a2233ee
共有 1 个文件被更改,包括 1 次插入3 次删除
  1. 1 3
      packages/color-picker/src/components/sv-panel.vue

+ 1 - 3
packages/color-picker/src/components/sv-panel.vue

@@ -47,9 +47,7 @@
         const value = this.color.get('value');
 
         const el = this.$el;
-        let { width, height } = el.getBoundingClientRect();
-
-        if (!height) height = width * 3 / 4;
+        let { clientWidth: width, clientHeight: height } = el;
 
         this.cursorLeft = saturation * width / 100;
         this.cursorTop = (100 - value) * height / 100;