前言
如何自定义vuepress
的首页设计风格呢?比如,我希望首页下面的红框内容是可点击的:
请看正文步骤
正文
在docs -> .vuepress
下新建theme
文件夹,再在theme
文件夹下新建components -> Home.vue
, 将vuepress -> packages -> @vuepress -> theme-default -> Home.vue
的源码拷贝至我们的Home.vue
即可,在源码里稍做修改便能满足我们的业务需求
改过后的Home.vue
代码如下所示:
<template>
<main
class="home"
:aria-labelledby="data.heroText !== null ? 'main-title' : null"
>
<header class="hero">
<img
v-if="data.heroImage"
:src="$withBase(data.heroImage)"
:alt="data.heroAlt || 'hero'"
>
<h1
v-if="data.heroText !== null"
id="main-title"
>
{
{ data.heroText || $title || 'Hello' }}
</h1>
<p
v-if="data.tagline !== null"</