From 1c788226de24ce0d1ac0fc4dad7150fcf6a7b3cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=9C=E5=BA=86=E6=B3=89?= Date: Tue, 10 Oct 2023 17:54:01 +0800 Subject: [PATCH] Update uts-plugin.md --- docs/plugin/uts-plugin.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/docs/plugin/uts-plugin.md b/docs/plugin/uts-plugin.md index ed2ae5bb8..add24f943 100644 --- a/docs/plugin/uts-plugin.md +++ b/docs/plugin/uts-plugin.md @@ -688,6 +688,16 @@ export function postUserInfo(user:UTSJSONObject){ } ``` +需要注意的是,如果声明为any, vue环境中的Object 在UTS环境中也会被 UTSJSONObjct. 也就是说上面的代码同样可以写作 + +```ts +// UTSJSONObjct 数据类型示例-2 +export function postUserInfo(user:any){ + console.log(user); +} +``` + + ```js // uni-app 调用代码 postUserInfo({ @@ -701,6 +711,7 @@ postUserInfo({ ``` + 更多UTSJSONObject的用法,[详见](../uts/data-type.md#UTSJSONObject) 遗留问题: -- GitLab