Skip to content

可以像用vue写网页一样,编写vue组件,并且直接用到md文档中吗? #1019

Answered by Chengyunlai
Chengyunlai asked this question in Q&A
Discussion options

You must be logged in to vote

嗯..感谢你的耐心回答:joy:
我再翻了翻手册看到下面的步骤,然后成功了..其实还是我文档没看仔细。问题解决了

  • STEP1

  • STEP2

我选择了第一种方法,我在config.js写入了

module.exports = {
  plugins: [
    registerComponentsPlugin({
      componentsDir: path.resolve(__dirname, './components'),
    }),
  ],
}

我的目录如下

├─ docs
│  ├─ .vuepress
│  ├─ │─ components
│  ├─ │ └─ A.vue
│  │  └─ config.js
│  └─ README.md

README.md中直接用<A></A>

😥 抱歉占用你的时间。

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
3 replies
@Chengyunlai
Comment options

@Mister-Hope
Comment options

@Mister-Hope
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by Chengyunlai
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants