提交 ba9ca8d1 编写于 作者: Q qiang

docs: uni type alias

上级 7cb5b7ab
......@@ -1017,7 +1017,8 @@ let i:tn = 0 // 等同于 let i:number = 0
上述简单的例子在实际开发中没有意义。
在 ts 中常见的用途是给联合类型命名,方便后续简化使用。但 uts 在app端不支持联合类型。
在 ts 中常见的用途是给联合类型命名,方便后续简化使用。但 uts 在app端不支持联合类型,在 uts 中用的比较多的场景是给[函数类型](./function.md#%E5%87%BD%E6%95%B0%E7%B1%BB%E5%9E%8B)定义别名,以便在共享给其他模块使用。
uts 中,type一般用于对象的定义,在编译为kotlin和swift时,会编译为class。
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册