bug修复

This commit is contained in:
xugaoyi 2020-02-25 14:32:12 +08:00
parent f926d9d1de
commit 860afca939
9 changed files with 112 additions and 69 deletions

View File

@ -31,8 +31,8 @@ if [ -z "$CODING_TOKEN" ]; then # -z 字符串 长度为0则为true$CODING_T
# codingUrl=git@git.dev.tencent.com:xugaoyi/xugaoyi.git
codingUrl=git@e.coding.net:xgy/xgy.git
else
# codingUrl=https://xugaoyi:${CODING_TOKEN}@git.dev.tencent.com/xugaoyi/xugaoyi.git
condingUrl=https://xgy:${CODING_TOKEN}@e.coding.net/xgy/xgy.git
# codingUrl=https://xugaoyi:${CODING_TOKEN}@git.dev.tencent.com/xugaoyi/xugaoyi.git
condingUrl=https://HmuzsGrGQX:${CODING_TOKEN}@e.coding.net/xgy/xgy.git
fi
git add -A
git commit -m "${msg}"

View File

@ -3,12 +3,12 @@
<div class="article-title">
<h1 v-if="pageMark === 'home'">
<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAYAAAA7MK6iAAAAAXNSR0IArs4c6QAABKFJREFUSA3tVl1oFVcQnrMbrak3QUgkya1akpJYcrUtIqW1JvFBE9LiQ5v6JmJpolbMg32rVrhgoYK0QiMY6i9Y6EMaW5D+xFJaTYItIuK2Kr3+BJNwkxBj05sQY3b3nM6cs2dv9t7NT/vQJw/sndk5M/PNzJkzewGerP+pAmy+ON8lLzUJgA8ZYxYIYZmGYRnctDaWvJJAmTtfP1pvXsBCCPP8QFcCaRkZYACgDZFO4stNIcBCajEOlmmC9XpJ9bAGCaPaPmzPl32dvLSVu3BWCTQs0XQQ6g0DYgwLIoAZbBCdW/i+781o1VVlm/410mw4h06Y7bIPHNyWDyL4FHkX03Q8SrzNhZTZriieckWt7cL6MM85YcLpsi/7O9/iXFT6MswI0DmmpkSaJ0qLxFIm3+i1THHB3zmBH3PYx9CcykcLOeQVVa7QtdxTgQgEleX2AjHYfwA+2ddV77ruGoJUbhGDI09YSNXyMpUt5ylOzxgbUmtOp7NmbNt8v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yWUvpAAAAABJRU5ErkJggg==">
文章
近更
</h1>
<span v-else>文章</span>
<span v-else>近更</span>
</div>
<div class="article-wrapper">
<dl v-for="(item, index) in topPublishPosts" :key="item.path">
<dl v-for="(item, index) in topPublishPosts" :key="item.key">
<dd>{{'0' + (index + 1)}}</dd>
<dt>
<a :href="item.path"><div>{{item.title}}</div></a>
@ -28,6 +28,8 @@
</template>
<script>
import { getTopKPosts } from '../util/getTopKPosts'
export default {
props: ['pageMark'],
data() {
@ -40,7 +42,8 @@ export default {
},
computed: {
topPublishPosts() {
return this.getTopKPosts()
// return this.getTopKPosts()
return getTopKPosts(this.posts, 5)
},
isShowArticle () {
const { frontmatter } = this.$page
@ -48,35 +51,35 @@ export default {
}
},
methods: {
getTopKPosts() { //
const re = /.*\/(.*?)\.(html|md)/
return this.posts
.filter(post => {
const { frontmatter } = post;
return frontmatter && frontmatter.permalink && frontmatter.title;
})
.map(post => {
const execs = re.exec(post.relativePath)
return {
...post,
updateTimestamp: (new Date(post.lastUpdated || post.frontmatter.date)).getTime(),
filename: execs ? execs['1'] : '',
formatDay: this.formatDate(new Date(post.lastUpdated || post.frontmatter.date))
}
})
.sort((a, b) => b.updateTimestamp - a.updateTimestamp)
.slice(0,5)
},
// getTopKPosts() { //
// const re = /.*\/(.*?)\.(html|md)/
// return this.posts
// .filter(post => {
// const { frontmatter } = post;
// return frontmatter && frontmatter.permalink && frontmatter.title && frontmatter.article !== false;
// })
// .map(post => {
// const execs = re.exec(post.relativePath)
// return {
// ...post,
// updateTimestamp: (new Date(post.lastUpdated || post.frontmatter.date)).getTime(),
// filename: execs ? execs['1'] : '',
// formatDay: this.formatDate(new Date(post.lastUpdated || post.frontmatter.date))
// }
// })
// .sort((a, b) => b.updateTimestamp - a.updateTimestamp)
// .slice(0,5)
// },
formatDate(date) { //
if (!(date instanceof Date)) {
return
}
return `${date.getFullYear()}/${this.zero(date.getMonth() + 1)}/${this.zero(date.getDate())}`
},
zero(d){ // 0
return d.toString().padStart(2,'0')
}
// formatDate(date) { //
// if (!(date instanceof Date)) {
// return
// }
// return `${date.getFullYear()}/${this.zero(date.getMonth() + 1)}/${this.zero(date.getDate())}`
// },
// zero(d){ // 0
// return d.toString().padStart(2,'0')
// }
}
}
</script>
@ -119,6 +122,8 @@ export default {
margin-left 30px
font-weight bold
line-height: 55px;
@media (max-width: $MQNarrow)
width 45px
dt
flex 1
display flex
@ -145,4 +150,6 @@ export default {
text-align right
font-size .9rem
line-height: 55px;
@media (max-width: $MQNarrow)
width 95px
</style>

View File

@ -0,0 +1,30 @@
const re = /.*\/(.*?)\.(html|md)/
export function getTopKPosts(posts, len) {
return posts
.filter(post => {
const { frontmatter } = post;
return frontmatter && frontmatter.permalink && frontmatter.title && frontmatter.article !== false;
})
.map(post => {
const execs = re.exec(post.relativePath)
return {
...post,
updateTimestamp: (new Date(post.lastUpdated || post.frontmatter.date)).getTime(),
filename: execs ? execs['1'] : '',
formatDay: formatDate(new Date(post.lastUpdated || post.frontmatter.date))
}
})
.sort((a, b) => b.updateTimestamp - a.updateTimestamp)
.slice(0,len)
}
function formatDate(date) { // 日期格式化
if (!(date instanceof Date)) {
return
}
return `${date.getFullYear()}/${zero(date.getMonth() + 1)}/${zero(date.getDate())}`
}
function zero(d) { // 补0
return d.toString().padStart(2,'0')
}

View File

@ -2,6 +2,7 @@
title: 学习网站
date: 2019-12-25
permalink: /pages/2e9ba3fa6e1ed0e9
article: false
---
# 学习网站

View File

@ -2,6 +2,7 @@
title: 在线工具
date: 2020-01-12
permalink: /pages/9c2232288caaa8ec
article: false
---
# 在线工具

View File

@ -2,6 +2,7 @@
title: 友情链接
date: 2019-12-25
permalink: /pages/844eea1b2387fb96
article: false
---
# 小伙伴们 o(^∇^*)

View File

@ -12,9 +12,7 @@ article: false
博主从事Web前端开发工作喜欢唱、跳、rap、篮球写程序。 本人↓↓↓
<img src="https://cdn.jsdelivr.net/gh/xugaoyi/image_store/blog/20200217210849.gif">
<!-- <img src="https://cdn.jsdelivr.net/gh/xugaoyi/image_store/blog/20200217210849.gif"> -->
<img src='https://cdn.jsdelivr.net/gh/xugaoyi/image_store/blog/20200103123203.jpg' alt='本人照片' style="width:106px;">
[更新日志](https://github.com/xugaoyi/blog/commits/master)

View File

@ -3,10 +3,10 @@ title: 最新
date: 2019-12-31
permalink: /pages/8818d4830dac5e2a
sidebar: false
article: false
article: false # 不显示最近更新栏,以及不参与到最近更新文章数据计算
---
# 最新文章
# 最近更
<ul class="page-guide-ul">
<li
@ -25,6 +25,8 @@ article: false
</div>
<script>
import { getTopKPosts } from '../.vuepress/theme/util/getTopKPosts'
export default {
data() {
return {
@ -45,41 +47,44 @@ export default {
computed: {
topPublishPosts() {
return this.getTopKPosts(this.page * this.step)
// return this.getTopKPosts(this.page * this.step)
return getTopKPosts(this.posts, this.page * this.step)
}
},
methods: {
getTopKPosts(num) { // 文章数据处理
const re = /.*\/(.*?)\.(html|md)/
return this.posts
.filter(post => {
const { frontmatter } = post;
return frontmatter && frontmatter.permalink && frontmatter.title;
})
.map(post => {
const execs = re.exec(post.relativePath)
return {
...post,
updateTimestamp: (new Date(post.lastUpdated || post.frontmatter.date)).getTime(),
filename: execs ? execs['1'] : '',
formatDay: this.formatDate(new Date(post.lastUpdated || post.frontmatter.date))
}
})
.sort((a, b) => b.updateTimestamp - a.updateTimestamp)
.slice(0, num)
},
// getTopKPosts(num) { // 文章数据处理
// const re = /.*\/(.*?)\.(html|md)/
// return this.posts
// .filter(post => {
// const { frontmatter } = post;
// return frontmatter && frontmatter.permalink && frontmatter.title && frontmatter.article !== false;
// })
// .map(post => {
// const execs = re.exec(post.relativePath)
// return {
// ...post,
// updateTimestamp: (new Date(post.lastUpdated || post.frontmatter.date)).getTime(),
// filename: execs ? execs['1'] : '',
// formatDay: this.formatDate(new Date(post.lastUpdated || post.frontmatter.date))
// }
// })
// .sort((a, b) => b.updateTimestamp - a.updateTimestamp)
// .slice(0, num)
// },
formatDate(date) { // 日期格式化
if (!(date instanceof Date)) {
return
}
// formatDate(date) { // 日期格式化
// if (!(date instanceof Date)) {
// return
// }
return `${date.getFullYear()}/${this.zero(date.getMonth() + 1)}/${this.zero(date.getDate())}`
},
zero(d){ // 补0
return d.toString().padStart(2,'0')
},
// return `${date.getFullYear()}/${this.zero(date.getMonth() + 1)}/${this.zero(date.getDate())}`
// },
// zero(d){ // 补0
// return d.toString().padStart(2,'0')
// },
loadMore() { // 加载更多
if (this.timeout) {
return

View File

@ -8,7 +8,7 @@ permalink: /pages/0796ba76b4b55368
# 基础篇
## 一、部分概念
## 一、JS的一些名词概念
#### 什么是作用域?