diff options
Diffstat (limited to '')
| -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 | ||
