昏喽喽

vuePress-theme-reco Lio    2020 - 2025
昏喽喽

Choose mode

  • dark
  • auto
  • light
Home
Category
  • CentOS
  • Csharp
  • DataBase
  • DesignMode
  • Vue
  • FrontEnd
  • GLD
  • Kingdee
  • NetWork
Tags
TimeLine
Tools
  • Http请求
  • 日志配置
  • 加密解密
  • 验证码
  • Git命令
About
author-avatar

Lio

103

Articles

15

Tags

Home
Category
  • CentOS
  • Csharp
  • DataBase
  • DesignMode
  • Vue
  • FrontEnd
  • GLD
  • Kingdee
  • NetWork
Tags
TimeLine
Tools
  • Http请求
  • 日志配置
  • 加密解密
  • 验证码
  • Git命令
About

Vuepress中使用Vue组件

vuePress-theme-reco Lio    2020 - 2025

Vuepress中使用Vue组件

Lio 2020-07-27 Vuepress

所有在.vuepress/components中找到的*.vue文件将会自动地被注册为全局的异步组件,如:

.
└─ .vuepress
   └─ components
      ├─ demo-1.vue
      ├─ OtherComponent.vue
      └─ Foo
         └─ Bar.vue
1
2
3
4
5
6
7

现在我们有一个组件是Example.vue

# 页面组件

我们现在有一个页面是Readme.md,然后在Front Matter里填写字段Layout: Example,此时整个页面会被组件代替

# 功能组件

有时候我们只是想在页面里引入一个小组件,而不是想引入一个页面。那么可以直接在Markdown文件里写下<Example/>(markdown文件里支持vue的语法,而组件被全局注册,所以直接写就行,另外还有一些表达式什么的都可以)

详细介绍文档可以见:Vuepress官方文档 (opens new window)