[临时修复]解决tooltip数据不更新的问题

This commit is contained in:
xumi
2021-12-13 22:53:13 +08:00
parent 5c11b731d5
commit 9d829729f4
2 changed files with 13 additions and 6 deletions

View File

@@ -1,6 +1,8 @@
<script lang="ts">
import usePopper from "../popper/usePopper";
import { defineComponent} from "vue";
import { on } from "../../tools/domUtil";
import { defineComponent, h, render} from "vue";
import popper from "../popper/index.vue";
export default defineComponent({
name: "LayTooltip",
props: {
@@ -23,7 +25,11 @@ export default defineComponent({
mounted() {
const _this = this;
this.$nextTick(() => {
usePopper.createPopper(_this.$el, _this.$props, "hover");
on(_this.$el, 'mouseenter', () => {
const container: HTMLDivElement = document.createElement("div");
render(h(popper, {...this.$props, el: this.$el}), container);
container.firstElementChild && document.body.appendChild(container.firstElementChild);
})
});
},
});