1.1.7 • Published 3 years ago

docusaurus-plugin-usevue v1.1.7

Weekly downloads
-
License
ISC
Repository
-
Last release
3 years ago

⚡安装

需要安装两个npm包:

yarn add docusaurus-plugin-usevue use-vue-component

另一个插件地址:use-vue-component

插件导入

docusaurus.config.js文件中,添加如下配置

module.exports = {
  // ...
    plugins: [
        //...
        'docusaurus-plugin-usevue'
    ],
};

用法

例如有如下场景

目录结构:

+-- docs
|   +-- test.vue
|   +-- intro.mdx

test.vue内容:

<template>
    <div class="red">
        hello world, this is {{name}}
    </div>
</template>

<script>
export default {
    data() {
        return {
            name: 'peter'
        }
    }
}
</script>

<style>
    .red {
        color: red
    }
</style>

intro.mdx内容:

---
sidebar_position: 1
---

## Getting Started

import {uvc} from 'use-vue-component'  //引入转换包
import test from './text.vue'  //引入vue组件

export const HelloWorld = uvc(test)  //转换

<HelloWorld/>

渲染结果

df

1.1.7

3 years ago

1.1.6

3 years ago

1.1.5

3 years ago

1.1.4

3 years ago

1.1.3

3 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.0.13

3 years ago

1.0.12

3 years ago

1.0.11

3 years ago

1.0.10

3 years ago

1.0.9

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago