Fix #1016, .at() is not support in Safari

This commit is contained in:
Louis Lam 2021-12-09 01:19:09 +08:00
parent f9cd0eb084
commit a4841eb8aa

View File

@ -49,8 +49,9 @@ export default {
computed: {
currentPage() {
let pathEnd = useRoute().path.split("/").at(-1);
if (pathEnd == "settings" || pathEnd == null) {
let pathSplit = useRoute().path.split("/");
let pathEnd = pathSplit[pathSplit.length - 1];
if (!pathEnd || pathEnd === "settings") {
return "general";
}
return pathEnd;