Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jiannei/milkdown-plugin-placeholder
Placeholder plugin for milkdown.
https://github.com/jiannei/milkdown-plugin-placeholder
milkdown placeholder plugin
Last synced: 5 days ago
JSON representation
Placeholder plugin for milkdown.
- Host: GitHub
- URL: https://github.com/jiannei/milkdown-plugin-placeholder
- Owner: jiannei
- License: mit
- Created: 2024-01-12T06:16:39.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2024-01-19T08:38:18.000Z (10 months ago)
- Last Synced: 2024-01-20T08:49:57.215Z (10 months ago)
- Topics: milkdown, placeholder, plugin
- Language: TypeScript
- Homepage:
- Size: 11.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Milkdown placeholder plugin.
> Placeholder plugin for milkdown.
![TypeScript](https://img.shields.io/badge/%3C%2F%3E-TypeScript-blue?style=flat&labelColor=black)
![NPM Version](https://img.shields.io/npm/v/%40s2nc%2Fmilkdown-plugin-placeholder?style=flat)
![NPM License](https://img.shields.io/npm/l/%40s2nc%2Fmilkdown-plugin-placeholder?style=flat)## 安装
```bash
npm i @s2nc/milkdown-plugin-placeholder
```## 使用
```js
import { placeholderCtx, placeholder as placeholderPlugin } from '@s2nc/milkdown-plugin-placeholder'
import { Milkdown, useEditor } from '@milkdown/vue'
import {rootCtx} from '@milkdown/core'const { loading, get } = useEditor((root) => {
return Editor.make()
.config((ctx) => {
// ...
// 编辑器初始化配置
ctx.set(rootCtx, root)// 覆盖默认的 placeholder
ctx.set(placeholderCtx, 'placeholder')})
.use([
placeholderPlugin,// 使用插件
])
})
```## 协议
MIT 许可证(MIT)。有关更多信息,请参见[协议文件](LICENSE)。