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: { computed: {
currentPage() { currentPage() {
let pathEnd = useRoute().path.split("/").at(-1); let pathSplit = useRoute().path.split("/");
if (pathEnd == "settings" || pathEnd == null) { let pathEnd = pathSplit[pathSplit.length - 1];
if (!pathEnd || pathEnd === "settings") {
return "general"; return "general";
} }
return pathEnd; return pathEnd;