From 49826a203c018296127ce7abb68a474af1948a04 Mon Sep 17 00:00:00 2001 From: Li Jin Date: Wed, 17 May 2023 10:59:39 +0800 Subject: update docs. --- doc/docs/doc/README.md | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'doc') 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 +Doing named export with destructuring. + +```moonscript +export :loadstring, to_lua: tolua = yue +export {itemA: {:fieldA = 'default'}} = tb +``` + +
+export :loadstring, to_lua: tolua = yue
+export {itemA: {:fieldA = 'default'}} = tb
+
+
+ +Export named items from module without creating local variables. + +```moonscript +export.itemA = tb +export. = items +export["a-b-c"] = 123 +``` + +
+export.itemA = tb
+export. = items
+export["a-b-c"] = 123
+
+
+ * **Unnamed Export** Unnamed export will add the target item into the array part of the exported table. -- cgit v1.2.3-55-g6feb