halo-admin/packages
Ryan Wang 673947b2d0
feat: add preset language support for codemirror components (#675)
#### What type of PR is this?

/kind feature
/milestone 2.0

#### What this PR does / why we need it:

为 Codemirror 组件添加更多预设语言支持,以及支持从外部传入语言包。

目前预设支持:

1. yaml
2. html
3. javascript
4. css
5. json

使用方式:

1. 使用预设

```vue
<script lang="ts" setup>
import { VCodemirror } from "@halo-dev/components"
</script>

<template>
    <VCodemirror language="html" />
</template>
```

2. 外部引入

```bash
pnpm install @codemirror/lang-java
```

```vue
<script lang="ts" setup>
import { VCodemirror } from "@halo-dev/components"
import { java } from "@codemirror/lang-java"
</script>

<template>
    <VCodemirror :language="java()" />
</template>
```

#### Special notes for your reviewer:

/cc @halo-dev/sig-halo-console 

#### Does this PR introduce a user-facing change?

```release-note
None
```
2022-11-01 06:18:16 +00:00
..
components feat: add preset language support for codemirror components (#675) 2022-11-01 06:18:16 +00:00
shared chore: release 2.0.0-alpha.3 (#669) 2022-10-26 07:48:10 +00:00