maping manual to json file

This commit is contained in:
AnandaTon 2024-06-21 15:26:11 +07:00
parent f5fe7f424c
commit 245d57fc93
2 changed files with 47 additions and 0 deletions

View file

@ -9,6 +9,7 @@ import { useCounterMixin } from "@/stores/mixin";
import http from "@/plugins/http";
import config from "@/app.config";
import manual from "@/manual.json";
import type {
ScrollType,
@ -474,6 +475,16 @@ watch(
}
}
);
const handleButtonClick = () => {
const currentPath = route.path;
const popupPath = manual[currentPath as keyof typeof manual];
if (popupPath) {
window.open(popupPath);
} else {
alert("No mapping found for this route");
}
};
</script>
<!-- โครงเว -->
@ -513,6 +524,17 @@ watch(
<q-icon name="mdi-magnify" size="20px" color="grey-7" />
</q-btn>
-->
<q-btn
round
dense
flat
size="13px"
class="q-mx-md bg-grey-3"
:color="totalNoti === 0 ? 'grey-6' : 'grey-8'"
@click="handleButtonClick()"
>
<q-icon name="mdi-book" size="18px" color="grey-7" />
</q-btn>
<!-- Notification -->
<q-btn
round