diff --git a/package.json b/package.json index 6f2f87d..c0ae27a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "wkitd", - "version": "1.3.9", + "version": "1.3.10", "type": "module", "main": "dist/index.js", "files": [ diff --git a/src/router/router-components.js b/src/router/router-components.js index 93d59e4..790507a 100644 --- a/src/router/router-components.js +++ b/src/router/router-components.js @@ -107,6 +107,7 @@ class RouterLink extends Component { a { display: flex; align-items: center; + justify-content: center; gap: var(--router-link-gap, 0); width: 100%; height: 100%; diff --git a/src/router/router-engine.js b/src/router/router-engine.js index c3bab17..b6074f5 100644 --- a/src/router/router-engine.js +++ b/src/router/router-engine.js @@ -106,6 +106,10 @@ class Router { ;[path, query] = path.split('?') } path = path.replace(PREFIX_REGEXP, '/') + // 修正默认主页,以支持带路径访问的首页 + if (path === '/index.html') { + path = '/' + } if (!$view || path === this.#route.path) { // query不同, 只更新query