From 27e3b6772fea6a0084abaf9bfb9a71121feb4594 Mon Sep 17 00:00:00 2001 From: bunny <1319900154@qq.com> Date: Sun, 13 Jul 2025 23:08:42 +0800 Subject: [PATCH] =?UTF-8?q?:sparkles:=20=E6=B7=BB=E5=8A=A0=E5=AF=BC?= =?UTF-8?q?=E8=88=AA=E6=A0=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../static/src/components/HeaderNavs.js | 29 +++++++++++++++++++ .../static/src/components/Pagination.js | 1 - .../static/src/lib/css/tablePage.css | 1 - .../resources/templates/permissionPage.html | 4 +++ .../main/resources/templates/rolePage.html | 8 +++-- .../main/resources/templates/userPage.html | 8 +++-- 6 files changed, 45 insertions(+), 6 deletions(-) create mode 100644 spring-security/step-2/src/main/resources/static/src/components/HeaderNavs.js diff --git a/spring-security/step-2/src/main/resources/static/src/components/HeaderNavs.js b/spring-security/step-2/src/main/resources/static/src/components/HeaderNavs.js new file mode 100644 index 0000000..4f37fdb --- /dev/null +++ b/spring-security/step-2/src/main/resources/static/src/components/HeaderNavs.js @@ -0,0 +1,29 @@ +const {defineComponent} = Vue; + +const HeaderNavs = defineComponent({ + name: 'HeaderNavs', + template: ` + + `, + data() { + return { + navList: ref([ + {href: "/login", title: "登录页面"}, + {href: "/user", title: "用户页面"}, + {href: "/role", title: "角色页面"}, + {href: "/permission", title: "权限页面"}, + ]) + }; + }, + methods: { + activeItem(nav) { + const pathname = window.location.pathname; + return pathname === nav.href; + }, + }, +}) \ No newline at end of file diff --git a/spring-security/step-2/src/main/resources/static/src/components/Pagination.js b/spring-security/step-2/src/main/resources/static/src/components/Pagination.js index 0c9229c..5318477 100644 --- a/spring-security/step-2/src/main/resources/static/src/components/Pagination.js +++ b/spring-security/step-2/src/main/resources/static/src/components/Pagination.js @@ -1,4 +1,3 @@ -const {defineComponent} = Vue; /* // pagination 类型 const pagination = { diff --git a/spring-security/step-2/src/main/resources/static/src/lib/css/tablePage.css b/spring-security/step-2/src/main/resources/static/src/lib/css/tablePage.css index aab529d..49ef8bb 100644 --- a/spring-security/step-2/src/main/resources/static/src/lib/css/tablePage.css +++ b/spring-security/step-2/src/main/resources/static/src/lib/css/tablePage.css @@ -1,6 +1,5 @@ body { background-color: #f8f9fa; - padding-top: 20px; } .card { diff --git a/spring-security/step-2/src/main/resources/templates/permissionPage.html b/spring-security/step-2/src/main/resources/templates/permissionPage.html index 96157fc..73bc2ea 100644 --- a/spring-security/step-2/src/main/resources/templates/permissionPage.html +++ b/spring-security/step-2/src/main/resources/templates/permissionPage.html @@ -36,6 +36,7 @@ +
@@ -133,6 +134,8 @@ + + @@ -220,6 +223,7 @@ }, }); + app.component('HeaderNavs', HeaderNavs) app.component('Pagination', Pagination) app.component('DialogPermission', DialogPermission) app.mount('#app'); diff --git a/spring-security/step-2/src/main/resources/templates/rolePage.html b/spring-security/step-2/src/main/resources/templates/rolePage.html index ec1eb16..c37b6b1 100644 --- a/spring-security/step-2/src/main/resources/templates/rolePage.html +++ b/spring-security/step-2/src/main/resources/templates/rolePage.html @@ -35,6 +35,7 @@
+
@@ -130,6 +131,8 @@ + + @@ -219,8 +222,9 @@ }, }); - app.component('Pagination', Pagination) - app.component('DialogRole', DialogRole) + app.component('HeaderNavs', HeaderNavs); + app.component('Pagination', Pagination); + app.component('DialogRole', DialogRole); app.mount('#app'); \ No newline at end of file diff --git a/spring-security/step-2/src/main/resources/templates/userPage.html b/spring-security/step-2/src/main/resources/templates/userPage.html index 767b4d8..1cad195 100644 --- a/spring-security/step-2/src/main/resources/templates/userPage.html +++ b/spring-security/step-2/src/main/resources/templates/userPage.html @@ -35,6 +35,7 @@
+
@@ -123,6 +124,8 @@ + + @@ -210,8 +213,9 @@ }, }); - app.component('Pagination', Pagination) - app.component('DialogUser', DialogUser) + app.component('HeaderNavs', HeaderNavs); + app.component('Pagination', Pagination); + app.component('DialogUser', DialogUser); app.mount('#app'); \ No newline at end of file