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

View File

@ -26,7 +26,7 @@
</FormSlot> </FormSlot>
<div class="buttons"> <div class="buttons">
<MkButton inline @click="addItem"><i class="ph-plus ph-bold ph-lg"></i> {{ i18n.ts.addItem }}</MkButton> <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> <MkButton inline primary class="save" @click="save"><i class="ph-floppy-disk ph-bold ph-lg"></i> {{ i18n.ts.save }}</MkButton>
</div> </div>