Front-end/lexical/开始.lexical

1 line
5.2 KiB
Plaintext
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{"editorState":{"root":{"children":[{"children":[{"detail":0,"format":0,"mode":"normal","style":"","text":"扩展编辑器","type":"text","version":1}],"direction":"ltr","format":"","indent":0,"type":"heading","version":1,"tag":"h1"},{"children":[{"detail":0,"format":0,"mode":"normal","style":"","text":"插件可以通过","type":"text","version":1},{"detail":0,"format":9,"mode":"normal","style":"","text":"命令、转换、节点","type":"text","version":1},{"detail":0,"format":0,"mode":"normal","style":"","text":"和其他API扩展编辑器。","type":"text","version":1}],"direction":"ltr","format":"","indent":0,"type":"paragraph","version":1},{"children":[{"detail":0,"format":0,"mode":"normal","style":"","text":"两种方式创建自己的节点","type":"text","version":1}],"direction":"ltr","format":"","indent":0,"type":"heading","version":1,"tag":"h1"},{"children":[{"detail":0,"format":0,"mode":"normal","style":"","text":"方式一","type":"text","version":1}],"direction":"ltr","format":"","indent":0,"type":"heading","version":1,"tag":"h2"},{"children":[{"detail":0,"format":0,"mode":"normal","style":"","text":"继承现有节点","type":"text","version":1}],"direction":"ltr","format":"","indent":0,"type":"paragraph","version":1},{"children":[{"children":[{"children":[{"detail":0,"format":16,"mode":"normal","style":"","text":"ElementNode","type":"text","version":1}],"direction":"ltr","format":"","indent":0,"type":"link","version":1,"rel":null,"target":null,"title":null,"url":"https://lexical.dev/docs/concepts/nodes#elementnode"},{"detail":0,"format":0,"mode":"normal","style":"","text":"  用作其他节点的父节点,可以是块级或内联。","type":"text","version":1}],"direction":"ltr","format":"","indent":0,"type":"listitem","version":1,"value":1},{"children":[{"children":[{"detail":0,"format":16,"mode":"normal","style":"","text":"TextNode","type":"text","version":1}],"direction":"ltr","format":"","indent":0,"type":"link","version":1,"rel":null,"target":null,"title":null,"url":"https://lexical.dev/docs/concepts/nodes#textnode"},{"detail":0,"format":0,"mode":"normal","style":"","text":" - 包含文本的节点的叶类型(","type":"text","version":1},{"detail":0,"format":2,"mode":"normal","style":"","text":"因此它不能有子元素","type":"text","version":1},{"detail":0,"format":0,"mode":"normal","style":"","text":")。","type":"text","version":1}],"direction":"ltr","format":"","indent":0,"type":"listitem","version":1,"value":2},{"children":[{"children":[{"detail":0,"format":16,"mode":"normal","style":"","text":"DecoratorNode","type":"text","version":1}],"direction":"ltr","format":"","indent":0,"type":"link","version":1,"rel":null,"target":null,"title":null,"url":"https://lexical.dev/docs/concepts/nodes#decoratornode"},{"detail":0,"format":0,"mode":"normal","style":"","text":" - 用于在编辑器中插入任意视图(组件)。","type":"text","version":1}],"direction":"ltr","format":"","indent":0,"type":"listitem","version":1,"value":3}],"direction":"ltr","format":"","indent":0,"type":"list","version":1,"listType":"bullet","start":1,"tag":"ul"},{"children":[{"detail":0,"format":0,"mode":"normal","style":"","text":"方式二","type":"text","version":1}],"direction":"ltr","format":"","indent":0,"type":"heading","version":1,"tag":"h2"},{"children":[{"detail":0,"format":0,"mode":"normal","style":"","text":"重写Node Overrides","type":"text","version":1}],"direction":"ltr","format":"","indent":0,"type":"paragraph","version":1},{"children":[{"detail":0,"format":0,"mode":"normal","style":"","text":"修改实例","type":"text","version":1}],"direction":"ltr","format":"","indent":0,"type":"heading","version":1,"tag":"h1"},{"children":[{"children":[{"detail":0,"format":0,"mode":"normal","style":"","text":"Trigger an update with ","type":"text","version":1},{"detail":0,"format":16,"mode":"normal","style":"","text":"editor.update()","type":"text","version":1}],"direction":"ltr","format":"","indent":0,"type":"listitem","version":1,"value":1},{"children":[{"detail":0,"format":0,"mode":"normal","style":"","text":"Setting the editor state via ","type":"text","version":1},{"detail":0,"format":16,"mode":"normal","style":"","text":"editor.setEditorState()","type":"text","version":1}],"direction":"ltr","format":"","indent":0,"type":"listitem","version":1,"value":2},{"children":[{"detail":0,"format":0,"mode":"normal","style":"","text":"Applying a change as part of an existing update via ","type":"text","version":1},{"detail":0,"format":16,"mode":"normal","style":"","text":"editor.registerNodeTransform()","type":"text","version":1}],"direction":"ltr","format":"","indent":0,"type":"listitem","version":1,"value":3},{"children":[{"detail":0,"format":0,"mode":"normal","style":"","text":"Using a command listener with ","type":"text","version":1},{"detail":0,"format":16,"mode":"normal","style":"","text":"editor.registerCommand(EXAMPLE_COMMAND, () => {...}, priority)","type":"text","version":1}],"direction":"ltr","format":"","indent":0,"type":"listitem","version":1,"value":4}],"direction":"ltr","format":"","indent":0,"type":"list","version":1,"listType":"bullet","start":1,"tag":"ul"},{"children":[],"direction":"ltr","format":"","indent":0,"type":"paragraph","version":1}],"direction":"ltr","format":"","indent":0,"type":"root","version":1}}}