1.1.1 • Published 2 years ago

@custom-wang-element/vue3 v1.1.1

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

简介

@custom-wang-element/vue3@custom-wang-element/corevue 3.0版本绑定。得益于ICmp的抽象接口,从而基于createCustomElement方法,定义了createCustomElementByVue3的方法。

createCustomElementByVue3对于createCustomElement方法的区别在于第二个参数的入参不再是CmpCreator,而是需要绑定的vue3组件。

createCustomElement的具体用法,查看@custom-wang-element/core说明文档

安装

@custom-wang-element/vue3依赖@custom-wang-element/corewangEditor

npm install @wangeditor/editor @custom-wang-element/core --save

然后再安装@custom-wang-element/vue3

npm install @custom-wang-element/vue3 --save

使用

在初始化wangEditor前,使用createCustomElementByVue3创建一个module并在注册

import CountBtn from '@/components/count-btn.vue' // 需要注册的vue组件
import { Boot } from '@wangeditor/editor'
import { createCustomElementByVue3 } from '@custom-wang-element/vue3'

// 使用createCustomElementByVue2创建一个wangEdior module,并注册
Boot.registerModule(createCustomElementByVue3('countbtn', CountBtn))

由于是基于@custom-wang-element/core,可以直接使用其内置的customWangElement方法创建一个SlateElement

import { customWangElement } from '@custom-wang-element/core'

customWangElement('countbtn', '0')

具体使用案例可以点击这个查看查看

1.1.1

2 years ago

1.1.0

2 years ago

1.0.0

2 years ago