方式
添加 2 个文件
.vuepress/theme/index.js1 2 3
| module.exports = { extend: '@vuepress/theme-default' }
|
.vuepress/theme/layouts/Layout.vue1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
| <template> <ParentLayout> <template #sidebar-top> <div>My custom sidebar-top</div> </template> <template #sidebar-bottom> <div>My custom sidebar-bottom</div> </template> <template #page-top> <div>My custom page-top</div> </template> <template #page-bottom> <div>My custom page-bottom</div> </template> </ParentLayout> </template>
<script> import ParentLayout from '@parent-theme/layouts/Layout.vue'
export default { name: 'Layout', components: { ParentLayout } } </script>
|
效果
适用版本
vuepress v1.5.4
Global Footer in Default Theme #339