feat: Add Editor component and add editor demo

This commit is contained in:
陈凯龙
2022-02-10 10:04:47 +08:00
parent 17e8e7cda9
commit 3fb3e8da39
10 changed files with 1034 additions and 5 deletions

27
types/custom-types.d.ts vendored Normal file
View File

@@ -0,0 +1,27 @@
import { SlateDescendant } from '@wangeditor/editor'
declare module 'slate' {
interface CustomTypes {
// 扩展 text
Text: {
text: string
bold?: boolean
italic?: boolean
code?: boolean
through?: boolean
underline?: boolean
sup?: boolean
sub?: boolean
color?: string
bgColor?: string
fontSize?: string
fontFamily?: string
}
// 扩展 Element 的 type 属性
Element: {
type: string
children: SlateDescendant[]
}
}
}