Skip to content

Latest commit

 

History

History
46 lines (32 loc) · 1.11 KB

README.md

File metadata and controls

46 lines (32 loc) · 1.11 KB

Milkdown placeholder plugin.

Placeholder plugin for milkdown.

TypeScript NPM Version NPM License

安装

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)。有关更多信息,请参见协议文件