waningflow / vue-virtual-table

vue table component of vue2
https://npmjs.com/vue-virtual-table
MIT License
105 stars 45 forks source link

Newer floating-vue package breaks if used alongside this project #35

Open MalteT opened 1 year ago

MalteT commented 1 year ago

Using vue-virtual-table and floating-vue alongside, breaks tooltips as floating-vue and v-tooltip race against each other. The following fix works for me (but is heavily untested):

diff --git a/src/vue-virtual-table.vue b/src/vue-virtual-table.vue
index 40114ec..18d40f9 100644
--- a/src/vue-virtual-table.vue
+++ b/src/vue-virtual-table.vue
@@ -413,7 +413,7 @@
                       'justify-content': item.justifyContent || 'center'
                     }"
                   >
-                    <VPopover trigger="hover" placement="right">
+                    <VTooltip trigger="hover" placement="right">
                       <span>
                         <span
                           v-if="item.prefix && getDescendantProp(props.item, item.prop)"
@@ -497,7 +497,7 @@
                           ></base-icon>
                         </div>
                       </template>
-                    </VPopover>
+                    </VTooltip>
                   </div>
                   <div
                     class="item-cell-inner"
@@ -598,7 +598,7 @@ import BaseTooltip from "./components/base-tooltip.vue";
 import BaseIcon from "./components/base-icon.vue";
 import "vue-resize/dist/vue-resize.css";
 import { _uuid, exportCsv, deepCopy, debounce } from "./utils/index.js";
-import { VPopover } from "v-tooltip";
+import { VTooltip } from "floating-vue";

 export default {
   name: "VueVirtualTable",
@@ -615,7 +615,7 @@ export default {
     BaseCheckgroup,
     BaseTooltip,
     BaseIcon,
-    VPopover
+    VTooltip
   },
   props: {
     config: {
diff --git a/package.json b/package.json
index 66a91a7..81b10ac 100644
--- a/package.json
+++ b/package.json
@@ -37,7 +37,7 @@
     "registry": "https://registry.npmjs.org"
   },
   "dependencies": {
-    "v-tooltip": "2.0.2",
+    "floating-vue": "^1.0.0-beta.17",
     "vue-observe-visibility": "^0.4.3",
     "vue-resize": "^0.4.5"
   },

I'm willing to send a PR, but I don't have the time to fully test these changes.