mirror of
https://github.com/Dvorinka/swingmusic-extended.git
synced 2026-06-04 20:43:04 +00:00
25 lines
461 B
TypeScript
25 lines
461 B
TypeScript
import { RouteLocationNormalized } from "vue-router";
|
|
|
|
function getElem(id: string, type: string) {
|
|
switch (type) {
|
|
case "class": {
|
|
return document.getElementsByClassName(id)[0];
|
|
}
|
|
case "id": {
|
|
return document.getElementById(id);
|
|
}
|
|
}
|
|
}
|
|
|
|
type r = RouteLocationNormalized;
|
|
|
|
function isSameRoute(to: r, from: r) {
|
|
if (to.params.path == from.params.path) {
|
|
return true;
|
|
}
|
|
|
|
return false;
|
|
}
|
|
|
|
export { getElem, isSameRoute };
|