diff --git a/website/docs/the-first-extension.md b/website/docs/the-first-extension.md index edc566511..bde007b96 100644 --- a/website/docs/the-first-extension.md +++ b/website/docs/the-first-extension.md @@ -7,7 +7,7 @@ sidebar_position: 1 In Molecule, all custom functions are done using [Extension](./guides/extension). Next, let us quickly learn how to write an extended application based on the [molecule-demo][demo-url] project. :::tip -All the codes are based on the [molecule-demo](https://github.com/DTStack/molecule-examples/tree/main/packages/molecule-demo) project in [Quick Start](./quick-start). +All the codes are based on the [molecule-demo](https://github.com/DTStack/molecule-examples/tree/main/molecule-demo) project in [Quick Start](./quick-start). ::: ## A simple scene @@ -94,7 +94,7 @@ export function handleSelectFolderTree() { After fetching the data of FolderTree successfully through `API.getFolderTree` ,we use the [`molecule.folderTree.add`](./api/classes/molecule.FolderTreeService#add) method to add and display data to the [FolderTree] component; next, monitor **the selected file** through the [`molecule.folderTree.onSelectFile`](./api/classes/molecule.FolderTreeService#onselectfile) method; finally,open the file through the [`molecule.editor.open`](./api/interfaces/molecule.IEditorService#open) method. :::caution -Pay more attention: In reality, the **data type** returned by `API.getFolderTree` is not [IFolderTreeNodeProps](./api/interfaces/molecule.model.IFolderTreeNodeProps) type, we often need to go through a **conversion** method. The mock data of the `API.getFolderTree` function in the example can be [View](https://github.com/DTStack/molecule-examples/blob/main/packages/molecule-demo/public/mock/folderTree.json). The `transformToEditorTab` in the `handleSelectFolderTree` method is a **transformation** method, which mainly converts `file` to [IEditorTab](./api/interfaces/molecule.model.IEditorTab) type. +Pay more attention: In reality, the **data type** returned by `API.getFolderTree` is not [IFolderTreeNodeProps](./api/interfaces/molecule.model.IFolderTreeNodeProps) type, we often need to go through a **conversion** method. The mock data of the `API.getFolderTree` function in the example can be [View](https://github.com/DTStack/molecule-examples/blob/main/molecule-demo/public/mock/folderTree.json). The `transformToEditorTab` in the `handleSelectFolderTree` method is a **transformation** method, which mainly converts `file` to [IEditorTab](./api/interfaces/molecule.model.IEditorTab) type. ::: ### Use extension @@ -135,6 +135,6 @@ Through it, we can extend many core modules such as [**ColorTheme**](./guides/ex Please [view][demo-url] the complete source code of **First Extension** -[demo-url]: https://github.com/DTStack/molecule-examples/tree/main/packages/molecule-demo/src/extensions/theFirstExtension +[demo-url]: https://github.com/DTStack/molecule-examples/tree/main/molecule-demo/src/extensions/theFirstExtension [foldertree-url]: ./guides/extend-builtin-ui#foldertree [create-url]: ./api#create