TypeError: Text.isText is not a function
TypeError: Text.isText is not a function
我正在学习关于 https://docs.slatejs.org/walkthroughs/04-applying-custom-formatting
的 slate 教程
有一个函数调用Text.isText(n),我不断得到Type:Error Text.isText is not a function
toggleBoldMark(editor) {
const isActive = CustomEditor.isBoldMarkActive(editor)
Transforms.setNodes(
editor,
{ bold: isActive ? null : true },
{ match: n => Text.isText(n), split: true }
)
},
尝试导入文本
import { Text } from 'slate';
我正在学习关于 https://docs.slatejs.org/walkthroughs/04-applying-custom-formatting
的 slate 教程有一个函数调用Text.isText(n),我不断得到Type:Error Text.isText is not a function
toggleBoldMark(editor) {
const isActive = CustomEditor.isBoldMarkActive(editor)
Transforms.setNodes(
editor,
{ bold: isActive ? null : true },
{ match: n => Text.isText(n), split: true }
)
},
尝试导入文本
import { Text } from 'slate';