Use optional chaining instead of repeated access (S6582)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-10 00:53:48 +08:00
parent d4429571d5
commit ad53494f26

View File

@@ -42,8 +42,7 @@ export const usePageAdminStore = defineStore("pageAdminStore", {
setActivePageComputedByRoute(routeMatched) { setActivePageComputedByRoute(routeMatched) {
if ( if (
routeMatched.length && routeMatched.length &&
routeMatched[routeMatched.length - 1] && routeMatched[routeMatched.length - 1]?.name
routeMatched[routeMatched.length - 1].name
) { ) {
printPageAdminLog && printPageAdminLog &&
console.log( console.log(