aboutsummaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorLi Jin <dragon-fly@qq.com>2023-05-17 10:59:39 +0800
committerLi Jin <dragon-fly@qq.com>2023-05-17 10:59:39 +0800
commit49826a203c018296127ce7abb68a474af1948a04 (patch)
tree5884e30d431cce541e3576b4e2af33b5f73ece8b /doc
parent78d5e6f44c06ac24aee667b5f9a9e642dcc6208d (diff)
downloadyuescript-49826a203c018296127ce7abb68a474af1948a04.tar.gz
yuescript-49826a203c018296127ce7abb68a474af1948a04.tar.bz2
yuescript-49826a203c018296127ce7abb68a474af1948a04.zip
update docs.
Diffstat (limited to 'doc')
-rwxr-xr-xdoc/docs/doc/README.md28
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
763Doing named export with destructuring.
764
765```moonscript
766export :loadstring, to_lua: tolua = yue
767export {itemA: {:fieldA = 'default'}} = tb
768```
769<YueDisplay>
770<pre>
771export :loadstring, to_lua: tolua = yue
772export {itemA: {:fieldA = 'default'}} = tb
773</pre>
774</YueDisplay>
775
776Export named items from module without creating local variables.
777
778```moonscript
779export.itemA = tb
780export.<index> = items
781export["a-b-c"] = 123
782```
783<YueDisplay>
784<pre>
785export.itemA = tb
786export.<index> = items
787export["a-b-c"] = 123
788</pre>
789</YueDisplay>
790
763* **Unnamed Export** 791* **Unnamed Export**
764Unnamed export will add the target item into the array part of the exported table. 792Unnamed export will add the target item into the array part of the exported table.
765 793