提交 7605b783 编写于 作者: 杜庆泉's avatar 杜庆泉

Update uts-plugin.md

上级 ae8efda9
......@@ -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 前端使用插件
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册