fix: wangEditor

This commit is contained in:
xingyu4j
2025-10-15 11:30:40 +08:00
parent 4e870d6980
commit 9e75e98a3f
3 changed files with 2 additions and 2 deletions

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

@ -0,0 +1,27 @@
import { SlateDescendant } from '@wangeditor-next/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[]
}
}
}