Skip to content
This repository has been archived by the owner on Dec 13, 2021. It is now read-only.

Commit

Permalink
fix: router info bug
Browse files Browse the repository at this point in the history
  • Loading branch information
dongyuanxin committed Jun 14, 2019
1 parent 3ffd8a6 commit 3e9f2c8
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 6 deletions.
15 changes: 12 additions & 3 deletions Comment.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,24 @@ let timer = null
export default {
mounted () {
timer = setTimeout(() => {
clear() && needComment(this.$frontmatter) && renderComment(this.$frontmatter)
const frontmatter = {
to: {},
from: {},
...this.$frontmatter
}
clear() && needComment(frontmatter) && renderComment(frontmatter)
}, 1000)
this.$router.afterEach((to, from) => {
if (to && from && to.path === from.path) {
return
}
clear() && needComment(this.$frontmatter) && renderComment(this.$frontmatter)
const frontmatter = {
to,
from,
...this.$frontmatter
}
clear() && needComment(frontmatter) && renderComment(frontmatter)
})
}
}
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ module.exports = {
options: {
id: '<%- frontmatter.commentid || frontmatter.permalink %>',
title: '「Comment」<%- frontmatter.title %>',
body: '<%- frontmatter.title %>:<%-window.location.origin%><%- window.location.pathname %>',
body: '<%- frontmatter.title %>:<%-window.location.origin %><%- frontmatter.to.path || window.location.pathname %>',
clientID: 'GitHub Application Client ID',
clientSecret: 'GitHub Application Client Secret',
repo: 'GitHub repo',
Expand Down
7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vuepress-plugin-comment",
"version": "0.5.1",
"version": "0.5.2",
"description": "Support popluar comment plugins in Vuepress, sucn as Gitalk, Valine, Disqus.",
"main": "index.js",
"scripts": {
Expand All @@ -26,6 +26,9 @@
"homepage": "https://github.com/dongyuanxin/vuepress-plugin-comment#readme",
"dependencies": {
"ejs": "^2.6.1",
"gitalk": "^1.5.0"
"gitalk": "^1.5.0",
"gitalk-fix": "^1.5.2",
"i": "^0.3.6",
"npm": "^6.9.0"
}
}

0 comments on commit 3e9f2c8

Please sign in to comment.