fix(vuepress-theme-reco): fix sidebar style error

This commit is contained in:
reco_luan 2020-07-06 00:21:56 +08:00
parent cd19231171
commit b18c80c84e

View File

@ -1,5 +1,5 @@
<template> <template>
<main class="page" :style="{ paddingRight: (this.$page.headers || []).length > 0 ? 'auto' : '0' }"> <main class="page" :style="pageStyle">
<ModuleTransition> <ModuleTransition>
<div v-show="recoShowModule && $page.title" class="page-title"> <div v-show="recoShowModule && $page.title" class="page-title">
<h1>{{$page.title}}</h1> <h1>{{$page.title}}</h1>
@ -170,6 +170,10 @@ export default {
return ( return (
this.$themeLocaleConfig.editLinkText || this.$themeConfig.editLinkText || `Edit this page` this.$themeLocaleConfig.editLinkText || this.$themeConfig.editLinkText || `Edit this page`
) )
},
pageStyle () {
const headers = this.$page.headers || []
return headers.length > 0 ? {} : { paddingRight: '0' }
} }
}, },