Skip to content

Commit dfddc97

Browse files
author
BiYuqi
committed
fix: nav link
1 parent 11f27ba commit dfddc97

File tree

3 files changed

+29
-12
lines changed

3 files changed

+29
-12
lines changed

.prettierrc.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
module.exports = {
2-
printWidth: 140,
3-
trailingComma: "none",
4-
tabWidth: 2,
5-
semi: false,
62
singleQuote: true,
7-
proseWrap: 'never'
8-
};
3+
printWidth: 120,
4+
proseWrap: 'never',
5+
semi: false,
6+
trailingComma: 'none',
7+
arrowParens: 'avoid'
8+
}

src/common/js/header.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,24 @@
11
$('.font-weight-normal').on('click', () => {
22
alert('哎呦, 点到我头了~~')
33
})
4+
5+
const demoNav = [
6+
{
7+
pagePath: WS_PLATFORM === 'github' ? '/webpack-seed/index.html' : '/index.html',
8+
display: '首页'
9+
},
10+
{
11+
pagePath: WS_PLATFORM === 'github' ? '/webpack-seed/html/test-page.html' : '/html/test-page.html',
12+
display: '测试页'
13+
},
14+
{
15+
pagePath: WS_PLATFORM === 'github' ? '/webpack-seed/html/fonts-page.html' : '/html/fonts-page.html',
16+
display: '图标页'
17+
}
18+
]
19+
20+
$('.nav-list').html(demoNav.map(info => `<a class="p-2 text-dark" href="${info.pagePath}">${info.display}</a>`))
21+
$('.nav-wrapper').append(`
22+
<a class="btn btn-outline-primary" href="${
23+
WS_PLATFORM === 'github' ? '/webpack-seed/html/login-page.html' : '/html/login-page.html'
24+
}">登录</a>`)

src/layout/base/header/header.ejs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
1-
<div class="d-flex flex-column flex-md-row align-items-center p-3 px-md-4 mb-3 bg-white border-bottom shadow-sm">
1+
<div class="nav-wrapper d-flex flex-column flex-md-row align-items-center p-3 px-md-4 mb-3 bg-white border-bottom shadow-sm">
22
<h5 class="my-0 mr-md-auto font-weight-normal">Webpack Seed</h5>
3-
<nav class="my-2 my-md-0 mr-md-3">
4-
<a class="p-2 text-dark" href="/index.html">首页</a>
5-
<a class="p-2 text-dark" href="/html/test-page.html">测试页</a>
6-
<a class="p-2 text-dark" href="/html/fonts-page.html">图标页面</a>
3+
<nav class="my-2 my-md-0 mr-md-3 nav-list">
74
</nav>
8-
<a class="btn btn-outline-primary" href="/html/login-page.html">登录</a>
95
</div>

0 commit comments

Comments
 (0)