diff options
author | Li Jin <dragon-fly@qq.com> | 2023-05-17 10:59:39 +0800 |
---|---|---|
committer | Li Jin <dragon-fly@qq.com> | 2023-05-17 10:59:39 +0800 |
commit | 49826a203c018296127ce7abb68a474af1948a04 (patch) | |
tree | 5884e30d431cce541e3576b4e2af33b5f73ece8b /doc | |
parent | 78d5e6f44c06ac24aee667b5f9a9e642dcc6208d (diff) | |
download | yuescript-49826a203c018296127ce7abb68a474af1948a04.tar.gz yuescript-49826a203c018296127ce7abb68a474af1948a04.tar.bz2 yuescript-49826a203c018296127ce7abb68a474af1948a04.zip |
update docs.
Diffstat (limited to 'doc')
-rwxr-xr-x | doc/docs/doc/README.md | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/doc/docs/doc/README.md b/doc/docs/doc/README.md index 3c910fd..faafd0c 100755 --- a/doc/docs/doc/README.md +++ b/doc/docs/doc/README.md | |||
@@ -760,6 +760,34 @@ export class Something | |||
760 | </pre> | 760 | </pre> |
761 | </YueDisplay> | 761 | </YueDisplay> |
762 | 762 | ||
763 | Doing named export with destructuring. | ||
764 | |||
765 | ```moonscript | ||
766 | export :loadstring, to_lua: tolua = yue | ||
767 | export {itemA: {:fieldA = 'default'}} = tb | ||
768 | ``` | ||
769 | <YueDisplay> | ||
770 | <pre> | ||
771 | export :loadstring, to_lua: tolua = yue | ||
772 | export {itemA: {:fieldA = 'default'}} = tb | ||
773 | </pre> | ||
774 | </YueDisplay> | ||
775 | |||
776 | Export named items from module without creating local variables. | ||
777 | |||
778 | ```moonscript | ||
779 | export.itemA = tb | ||
780 | export.<index> = items | ||
781 | export["a-b-c"] = 123 | ||
782 | ``` | ||
783 | <YueDisplay> | ||
784 | <pre> | ||
785 | export.itemA = tb | ||
786 | export.<index> = items | ||
787 | export["a-b-c"] = 123 | ||
788 | </pre> | ||
789 | </YueDisplay> | ||
790 | |||
763 | * **Unnamed Export** | 791 | * **Unnamed Export** |
764 | Unnamed export will add the target item into the array part of the exported table. | 792 | Unnamed export will add the target item into the array part of the exported table. |
765 | 793 | ||