Commit cdb135c9e5aa944c6216a125125d150f0e9b4776

Authored by fengtao
1 parent 1e2ff688

fix: 修复针对火狐浏览器,vue draggable拖拽插件在拖拽组件时会新开一个窗口的问题

... ... @@ -50,7 +50,7 @@
50 50 </template>
51 51
52 52 <script setup lang="ts">
53   -import { PropType, watch, ref, Ref, computed, nextTick } from 'vue'
  53 +import { PropType, watch, ref, Ref, computed, nextTick, onMounted } from 'vue'
54 54 import { MacOsControlBtn } from '@/components/Tips/MacOsControlBtn/index'
55 55 import { ChartGlobImage } from '@/components/Pages/ChartGlobImage'
56 56 import { useChartEditStore } from '@/store/modules/chartEditStore/chartEditStore'
... ... @@ -166,6 +166,18 @@ watch(
166 166 }
167 167 }
168 168 )
  169 +
  170 +/**
  171 + * 修复vue draggable拖拽插件在火狐浏览器上确实会存在拖拽会新开一个窗口,属于官方问题,其他浏览器不存在此问题。
  172 + * 解决代码如下
  173 + */
  174 +onMounted(() => {
  175 + document.body.ondrop = function (event) {
  176 + event.preventDefault()
  177 + event.stopPropagation()
  178 + }
  179 +})
  180 +//
169 181 </script>
170 182
171 183 <style lang="scss" scoped>
... ...