diff --git a/playground-vue2/src/App.vue b/playground-vue2/src/App.vue index 842ede9..f2ceb77 100644 --- a/playground-vue2/src/App.vue +++ b/playground-vue2/src/App.vue @@ -109,7 +109,7 @@ function useMousePosition() { export default defineComponent({ setup() { const counter = ref(0) - window.counter = counter; + const button = ref() const button2 = ref() const button3 = ref() @@ -173,32 +173,32 @@ export default defineComponent({ options.content = String(parseInt(options.content) + 1) } - // const { x, y } = useMousePosition() + const { x, y } = useMousePosition() - // const { tippy } = useTippy(() => document.body, { - // content: computed(() => `(${x.value},${y.value})`), - // showOnCreate: true, - // trigger: 'manual', - // // sticky: true, // slow? - // placement: 'top', - // hideOnClick: false, - // arrow: ``, - // getReferenceClientRect: function () { - // return { - // width: 0, - // height: 0, - // top: y.value, - // right: x.value, - // bottom: y.value, - // left: x.value, - // } - // }, - // }) + const { tippy } = useTippy(() => document.body, { + content: computed(() => `(${x.value},${y.value})`), + showOnCreate: true, + trigger: 'manual', + // sticky: true, // slow? + placement: 'top', + hideOnClick: false, + arrow: ``, + getReferenceClientRect: function () { + return { + width: 0, + height: 0, + top: y.value, + right: x.value, + bottom: y.value, + left: x.value, + } + }, + }) - // watch([x, y], () => { - // if (tippy.value && tippy.value.popperInstance) - // tippy.value.popperInstance.update() - // }) + watch([x, y], () => { + if (tippy.value && tippy.value.popperInstance) + tippy.value.popperInstance.update() + }) const singleton1 = ref() const singleton2 = ref()