This commit is contained in:
Georges KABBOUCHI
2021-01-01 02:06:15 +02:00
parent d4ae979fa0
commit 1e06a5a779
2 changed files with 31 additions and 31 deletions
+27 -27
View File
@@ -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()
@@ -129,8 +129,8 @@ export default defineComponent({
})
useTippy(button3, {
content: computed(() =>
h(
content: defineComponent(() =>
() => h(
'button',
{
on: {
@@ -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: `<svg style="color: black;width:20px;height:20px" fill="currentColor" viewBox="0 0 20 20"><path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-8.707l-3-3a1 1 0 00-1.414 0l-3 3a1 1 0 001.414 1.414L9 9.414V13a1 1 0 102 0V9.414l1.293 1.293a1 1 0 001.414-1.414z" clip-rule="evenodd"></path></svg>`,
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: `<svg style="color: black;width:20px;height:20px" fill="currentColor" viewBox="0 0 20 20"><path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-8.707l-3-3a1 1 0 00-1.414 0l-3 3a1 1 0 001.414 1.414L9 9.414V13a1 1 0 102 0V9.414l1.293 1.293a1 1 0 001.414-1.414z" clip-rule="evenodd"></path></svg>`,
// 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()
+4 -4
View File
@@ -7979,10 +7979,10 @@ vue-template-es2015-compiler@^1.9.0:
resolved "https://registry.yarnpkg.com/vue-template-es2015-compiler/-/vue-template-es2015-compiler-1.9.1.tgz#1ee3bc9a16ecbf5118be334bb15f9c46f82f5825"
integrity sha512-4gDntzrifFnCEvyoO8PqyJDmguXgVPxKiIxrBKjIowvL9l+N66196+72XVYR8BBf1Uv1Fgt3bGevJ+sEmxfZzw==
vue-tippy@^6.0.0-alpha.13:
version "6.0.0-alpha.13"
resolved "https://registry.yarnpkg.com/vue-tippy/-/vue-tippy-6.0.0-alpha.13.tgz#538d2c3efecac9a225aa32439abbab07dc8eab88"
integrity sha512-UNylZb/JMyGwOsvBgDFLMVe08+ClhGdb3axMRjgSMu/eYaL5gNVh6AzQvJrtg+nfIqy7lHEyeXFM6xTtAasrsQ==
vue-tippy@^6.0.0-alpha.14:
version "6.0.0-alpha.14"
resolved "https://registry.yarnpkg.com/vue-tippy/-/vue-tippy-6.0.0-alpha.14.tgz#550d191ea3ef22082946d485a9c101ddb262d064"
integrity sha512-D6lKNDlYZBjG6XYqZhByT5WKOWnQIBB2BVznPsdNLwA4YSO8WpIjppdhwYADBJv9XNUGxPn8ilOMxusHpj1Fng==
dependencies:
tippy.js "^6.2.6"
vue-demi "^0.5.3"