Skip to content

Commit

Permalink
feat: dynamic md with $route
Browse files Browse the repository at this point in the history
  • Loading branch information
deot committed Sep 7, 2020
1 parent b8851dd commit 543f133
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions packages/cli/src/client/components/default.vue
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ export default {
},
computed: {
contentStyle() {
return this.$parent.sidebar
return this.$parent.sidebar
? {
marginLeft: '300px',
marginLeft: '300px',
paddingBottom: '60px',
paddingRight: '130px'
}
Expand All @@ -48,7 +48,7 @@ export default {
immediate: true,
handler(v, oldV) {
this.loadData();
document.documentElement.scrollTop = 0;
document.documentElement.scrollTop = 0;
}
}
},
Expand All @@ -64,11 +64,11 @@ export default {
async loadData() {
let { name: $name } = this.$route.params;
let $locale = this.$route.path.split('/')[1];
let { baseMDDir } = this.$global.docConfig;
let url = typeof baseMDDir === 'string'
let url = typeof baseMDDir === 'string'
? `${location.origin}${baseMDDir}${$locale}/${$name}.md`
: baseMDDir($locale, $name);
: baseMDDir($locale, $name, this.$route);
let data;
Expand Down

0 comments on commit 543f133

Please sign in to comment.