From 7605b783977035cb9b51cdc8c4146fae1b2af6fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=9C=E5=BA=86=E6=B3=89?= Date: Tue, 29 Nov 2022 18:01:23 +0800 Subject: [PATCH] Update uts-plugin.md --- docs/plugin/uts-plugin.md | 53 +++++++++++++++++++++++++++++++++++++-- 1 file changed, 51 insertions(+), 2 deletions(-) diff --git a/docs/plugin/uts-plugin.md b/docs/plugin/uts-plugin.md index 75a4b8a8c..1056ab739 100644 --- a/docs/plugin/uts-plugin.md +++ b/docs/plugin/uts-plugin.md @@ -514,10 +514,59 @@ export function getPluginVersion(): JSONObject{ uni-app向UTS环境传值 1 TS基本数据类型: Number,string,boolean 等 +```ts +// 基础数据类型示例 +export function postUserInfo(name:string,age:Number){ + console.log("name == " + name); + console.log("age == " + age); +} +``` + +```js +// uni-app 调用代码 +postUserInfo("zhangsan",12); +``` + 2 type数据类型 -3 数组类型 -4 支持UTSJSONObjct +```ts +// type 数据类型示例 +export function postUserInfo(name:string,age:Number){ + console.log("name == " + name); + console.log("age == " + age); +} +``` + +```js +// uni-app 调用代码 +postUserInfo({ + name:"zhangsan", + age:12 +}); +``` + + +3 UTSJSONObjct + +```ts +// UTSJSONObjct 数据类型示例 +export function postUserInfo(user:UTSJSONObject){ + console.log(user); +} +``` + +```js +// uni-app 调用代码 +postUserInfo({ + name:"zhangsan", + age:12, + scoreInfo:{ + "语文":100, + "数学":80, + } +}); + +``` ## 4 前端使用插件 -- GitLab