Commit 93f102899ba0d46a4b9d000478f53fd4d339b961
Merge branch 'fix/firefox-bug/08-1' into 'main_dev'
fix: 修复针对火狐浏览器,vue draggable拖拽插件在拖拽组件时会新开一个窗口的问题 See merge request yunteng/thingskit-view!281
Showing
1 changed file
with
13 additions
and
1 deletions
@@ -50,7 +50,7 @@ | @@ -50,7 +50,7 @@ | ||
50 | </template> | 50 | </template> |
51 | 51 | ||
52 | <script setup lang="ts"> | 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 | import { MacOsControlBtn } from '@/components/Tips/MacOsControlBtn/index' | 54 | import { MacOsControlBtn } from '@/components/Tips/MacOsControlBtn/index' |
55 | import { ChartGlobImage } from '@/components/Pages/ChartGlobImage' | 55 | import { ChartGlobImage } from '@/components/Pages/ChartGlobImage' |
56 | import { useChartEditStore } from '@/store/modules/chartEditStore/chartEditStore' | 56 | import { useChartEditStore } from '@/store/modules/chartEditStore/chartEditStore' |
@@ -166,6 +166,18 @@ watch( | @@ -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 | </script> | 181 | </script> |
170 | 182 | ||
171 | <style lang="scss" scoped> | 183 | <style lang="scss" scoped> |