Skip to content

Commit

Permalink
docs: update README
Browse files Browse the repository at this point in the history
  • Loading branch information
imguolao committed Sep 12, 2024
1 parent c92f3d1 commit 7c5d06b
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 10 deletions.
11 changes: 7 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Use `monaco-editor` loaded from CDN in Vue 2&3, no need to bundling.

[![gitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/imguolao/monaco-vue/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/@guolao/vue-monaco-editor.svg?style=flat)](https://www.npmjs.com/package/@guolao/vue-monaco-editor)
[![gitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/imguolao/monaco-vue/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/@guolao/vue-monaco-editor.svg?style=flat)](https://www.npmjs.com/package/@guolao/vue-monaco-editor) [![npm downloads](https://img.shields.io/npm/dm/%40guolao%2Fvue-monaco-editor)](https://www.npmjs.com/package/@guolao/vue-monaco-editor)

English | [简体中文](https://github.com/imguolao/monaco-vue/blob/main/README.zh-CN.md)

Expand All @@ -12,7 +12,7 @@ The `monaco-editor` doesn't support ESM very well, which results in large files

But the official team has written a loader to lazy load files of the editor remotely, so we can load the files from a CDN to use it.

If you still want to import `monaco-editor` files from `node_modules` and bundle them into your code (without using remote loading), you will need to use a bundling tool.See [here](#npm-package).
If you still want to import `monaco-editor` files from `node_modules` and bundle them into your code (without using remote loading), you will need to use a bundling tool. See [here](#npm-package).

## Installation

Expand All @@ -39,7 +39,7 @@ Of course, you can also use [unpkg](https://unpkg.com/@guolao/vue-monaco-editor/

## Usage

Register the component.
**Global Registration**

```ts
import { createApp } from 'vue'
Expand All @@ -52,8 +52,11 @@ app.use(VueMonacoEditorPlugin, {
vs: 'https://cdn.jsdelivr.net/npm/monaco-editor@0.43.0/min/vs'
},
})
```

**Local Registration**

// You can also:
```ts
// main.ts
import { loader } from '@guolao/vue-monaco-editor'
loader.config({
Expand Down
7 changes: 5 additions & 2 deletions README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

`Vue 2&3` 中使用从 CDN 远程加载的 `monaco-editor`,不需要打包。

[![gitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/imguolao/monaco-vue/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/@guolao/vue-monaco-editor.svg?style=flat)](https://www.npmjs.com/package/@guolao/vue-monaco-editor)
[![gitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/imguolao/monaco-vue/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/@guolao/vue-monaco-editor.svg?style=flat)](https://www.npmjs.com/package/@guolao/vue-monaco-editor) [![npm downloads](https://img.shields.io/npm/dm/%40guolao%2Fvue-monaco-editor)](https://www.npmjs.com/package/@guolao/vue-monaco-editor)

简体中文 | [English](https://github.com/imguolao/monaco-vue/blob/main/README.md)

Expand Down Expand Up @@ -52,8 +52,11 @@ app.use(VueMonacoEditorPlugin, {
vs: 'https://cdn.jsdelivr.net/npm/monaco-editor@0.43.0/min/vs'
},
})
```

不全局注册组件

// 也可以不全局注册组件
```ts
// main.ts
import { loader } from '@guolao/vue-monaco-editor'
loader.config({
Expand Down
11 changes: 7 additions & 4 deletions packages/editor/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Use `monaco-editor` loaded from CDN in Vue 2&3, no need to bundling.

[![gitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/imguolao/monaco-vue/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/@guolao/vue-monaco-editor.svg?style=flat)](https://www.npmjs.com/package/@guolao/vue-monaco-editor)
[![gitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/imguolao/monaco-vue/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/@guolao/vue-monaco-editor.svg?style=flat)](https://www.npmjs.com/package/@guolao/vue-monaco-editor) [![npm downloads](https://img.shields.io/npm/dm/%40guolao%2Fvue-monaco-editor)](https://www.npmjs.com/package/@guolao/vue-monaco-editor)

English | [简体中文](https://github.com/imguolao/monaco-vue/blob/main/README.zh-CN.md)

Expand All @@ -12,7 +12,7 @@ The `monaco-editor` doesn't support ESM very well, which results in large files

But the official team has written a loader to lazy load files of the editor remotely, so we can load the files from a CDN to use it.

If you still want to import `monaco-editor` files from `node_modules` and bundle them into your code (without using remote loading), you will need to use a bundling tool.See [here](#npm-package).
If you still want to import `monaco-editor` files from `node_modules` and bundle them into your code (without using remote loading), you will need to use a bundling tool. See [here](#npm-package).

## Installation

Expand All @@ -39,7 +39,7 @@ Of course, you can also use [unpkg](https://unpkg.com/@guolao/vue-monaco-editor/

## Usage

Register the component.
**Global Registration**

```ts
import { createApp } from 'vue'
Expand All @@ -52,8 +52,11 @@ app.use(VueMonacoEditorPlugin, {
vs: 'https://cdn.jsdelivr.net/npm/monaco-editor@0.43.0/min/vs'
},
})
```

**Local Registration**

// You can also:
```ts
// main.ts
import { loader } from '@guolao/vue-monaco-editor'
loader.config({
Expand Down

0 comments on commit 7c5d06b

Please sign in to comment.