diff --git a/_includes/main-mirror-list.html b/_includes/main-mirror-list.html index 2b26585..6a7ab5e 100644 --- a/_includes/main-mirror-list.html +++ b/_includes/main-mirror-list.html @@ -38,7 +38,9 @@ + :data-bs-content="mir.description" :href="getURL(mir)" :aria-label="mir.name + ', ' + mir.description" + v-with-popover + > {{mir.name}} new diff --git a/_src/components/MainMirrorList.vue b/_src/components/MainMirrorList.vue index 3251e9b..9b6dbf1 100644 --- a/_src/components/MainMirrorList.vue +++ b/_src/components/MainMirrorList.vue @@ -98,11 +98,14 @@ onMounted(() => { }); }); -onUpdated(() => { - Array.from(document.getElementsByClassName("mirror-item-label")).map((el) => { - new BootStrapPopover(el); - }); -}); +const vWithPopover = { + mounted: (el) => { + BootStrapPopover.getOrCreateInstance(el); + }, + beforeUnmount: (el) => { + BootStrapPopover.getInstance(el)?.dispose(); + }, +}; const sortAndUniqMirrors = (mirs) => { mirs.sort((a, b) => {