Skip to content

Commit

Permalink
feat($theme-default): display els of page bottom after content mounted
Browse files Browse the repository at this point in the history
  • Loading branch information
ulivz committed Nov 5, 2018
1 parent d658169 commit d9a8ced
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
4 changes: 4 additions & 0 deletions packages/@vuepress/core/lib/app/components/Content.vue
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,14 @@ export default {
created () {
this.loadContent(this.$key)
this.$vuepress.$on('AsyncMarkdownContentMounted', (slotKey) => {
this.$vuepress.$set('contentMounted', true)
})
},
watch: {
$key (key) {
this.$vuepress.$set('contentMounted', false)
this.reloadContent(key)
}
},
Expand Down
11 changes: 6 additions & 5 deletions packages/@vuepress/theme-default/components/Page.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<Content/>

<div class="page-edit">
<div class="page-edit" v-if="contentMounted">
<div
class="edit-link"
v-if="editLink"
Expand All @@ -26,7 +26,7 @@
</div>
</div>

<div class="page-nav" v-if="prev || next">
<div class="page-nav" v-if="contentMounted && (prev || next)">
<p class="inner">
<span
v-if="prev"
Expand Down Expand Up @@ -67,10 +67,11 @@ import { resolvePage, normalize, outboundRE, endingSlashRE } from '../util'
export default {
props: ['sidebarItems'],
data () {
},
computed: {
contentMounted () {
return this.$vuepress.$get('contentMounted')
},
lastUpdated () {
if (this.$page.lastUpdated) {
return new Date(this.$page.lastUpdated).toLocaleString(this.$lang)
Expand Down

0 comments on commit d9a8ced

Please sign in to comment.