@s2nc/milkdown-plugin-placeholder
v0.3.0
Published
Placeholder plugin for milkdown.
Downloads
10
Maintainers
Readme
Placeholder plugin for milkdown.
安装
npm i @s2nc/milkdown-plugin-placeholder
使用
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)。有关更多信息,请参见协议文件。