Front-end/lexical/开始.lexical

1 line
5.2 KiB
Plaintext
Raw Permalink Normal View History

2024-09-21 23:58:12 -04:00
{"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","sty