เพิ่ม query string
This commit is contained in:
parent
7bb72d96f9
commit
f46ef6bd8e
1 changed files with 10 additions and 7 deletions
|
|
@ -477,14 +477,17 @@ watch(
|
||||||
|
|
||||||
const handleButtonClick = () => {
|
const handleButtonClick = () => {
|
||||||
const currentPath = route.name;
|
const currentPath = route.name;
|
||||||
// const popupPath =
|
const queryParams = { role: "officer" }; // Replace with your query parameters
|
||||||
// config.manualConfig[currentPath as keyof typeof config.manualConfig];
|
const queryString = new URLSearchParams(queryParams).toString();
|
||||||
const popupPath = config.generatePopupPath(currentPath);
|
|
||||||
if (popupPath) {
|
// Assuming config.generatePopupPath() returns a base URL
|
||||||
// console.log(currentPath);
|
const popupBasePath = config.generatePopupPath(currentPath);
|
||||||
window.open(popupPath);
|
|
||||||
|
if (popupBasePath) {
|
||||||
|
const popupPath = `${popupBasePath}?${queryString}`;
|
||||||
|
window.open(popupPath, "_blank"); // Opens in a new tab/window
|
||||||
} else {
|
} else {
|
||||||
console.log("no manual in this page ", currentPath);
|
console.log("No manual available for this page:", currentPath);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue