0.3.0 • Published 4 months ago

@s2nc/milkdown-plugin-placeholder v0.3.0

Weekly downloads
-
License
MIT
Repository
github
Last release
4 months ago

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

0.3.0

4 months ago

0.2.2

4 months ago

0.2.1

4 months ago

0.2.0

4 months ago

0.1.0

5 months ago