add reload

This commit is contained in:
moshibar 2023-07-23 16:06:53 -04:00
parent 77cfb03b1c
commit ff8d8ae73c
2 changed files with 17 additions and 7 deletions

View file

@ -24,7 +24,7 @@
</template>
<div class="yrolvcoq" :style="{ background: pageMetadata?.value?.bg }">
<RouterView :router="router" />
<RouterView :key="reloadCount" :router="router" />
</div>
</XWindow>
</template>
@ -78,6 +78,11 @@ const buttonsLeft = $computed(() => {
});
const buttonsRight = $computed(() => {
const buttons = [
{
icon: 'ph-arrow-clockwise ph-bold ph-lg',
title: i18n.ts.reload,
onClick: reload,
},
{
icon: "ph-arrows-out-simple ph-bold ph-lg",
title: i18n.ts.showInPage,
@ -87,6 +92,7 @@ const buttonsRight = $computed(() => {
return buttons;
});
let reloadCount = $ref(0);
router.addListener("push", (ctx) => {
history.push({ path: ctx.path, key: ctx.key });
@ -140,6 +146,10 @@ function back() {
);
}
function reload() {
reloadCount++;
}
function close() {
windowEl.close();
}

View file

@ -26,7 +26,7 @@
</FormSlot>
<div class="buttons">
<MkButton inline @click="addItem"><i class="ph-plus ph-bold ph-lg"></i> {{ i18n.ts.addItem }}</MkButton>
<MkButton inline danger @click="reset"><i class="ph-arrows-clockwise ph-bold ph-lg"></i> {{ i18n.ts.default }}</MkButton>
<MkButton inline danger @click="reset"><i class="ph-arrow-clockwise ph-bold ph-lg"></i> {{ i18n.ts.default }}</MkButton>
<MkButton inline primary class="save" @click="save"><i class="ph-floppy-disk ph-bold ph-lg"></i> {{ i18n.ts.save }}</MkButton>
</div>