Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
unidocs-uni-app-x-zh
提交
1072dd69
U
unidocs-uni-app-x-zh
项目概览
DCloud
/
unidocs-uni-app-x-zh
通知
200
Star
3
Fork
46
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
14
列表
看板
标记
里程碑
合并请求
16
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
U
unidocs-uni-app-x-zh
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
14
Issue
14
列表
看板
标记
里程碑
合并请求
16
合并请求
16
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
1072dd69
编写于
6月 21, 2024
作者:
D
DCloud_LXH
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat(uts): uts 内置对象 Constructor
上级
380aff2d
变更
6
展开全部
隐藏空白更改
内联
并排
Showing
6 changed file
with
4498 addition
and
7 deletion
+4498
-7
docs/.vuepress/utils/utsJson.json
docs/.vuepress/utils/utsJson.json
+4361
-1
docs/uts/buildin-object-api/array.md
docs/uts/buildin-object-api/array.md
+37
-3
docs/uts/buildin-object-api/date.md
docs/uts/buildin-object-api/date.md
+37
-1
docs/uts/buildin-object-api/map.md
docs/uts/buildin-object-api/map.md
+25
-1
docs/uts/buildin-object-api/number.md
docs/uts/buildin-object-api/number.md
+13
-0
docs/uts/buildin-object-api/regexp.md
docs/uts/buildin-object-api/regexp.md
+25
-1
未找到文件。
docs/.vuepress/utils/utsJson.json
浏览文件 @
1072dd69
此差异已折叠。
点击以展开。
docs/uts/buildin-object-api/array.md
浏览文件 @
1072dd69
...
...
@@ -2,8 +2,44 @@
Array 对象是用于构造数组的全局对象,数组是类似于列表的高阶对象。
## 实例属性
### Constructor(arrayLength?)
<!-- UTSJSON.Array.Constructor.description -->
<!-- UTSJSON.Array.Constructor.param -->
<!-- UTSJSON.Array.Constructor.returnValue -->
<!-- UTSJSON.Array.Constructor.compatibility -->
<!-- UTSJSON.Array.Constructor.tutorial -->
### Constructor(arrayLength)_1
<!-- UTSJSON.Array.Constructor_1.description -->
<!-- UTSJSON.Array.Constructor_1.param -->
<!-- UTSJSON.Array.Constructor_1.returnValue -->
<!-- UTSJSON.Array.Constructor_1.compatibility -->
<!-- UTSJSON.Array.Constructor_1.tutorial -->
### Constructor(...items)_2
<!-- UTSJSON.Array.Constructor_2.description -->
<!-- UTSJSON.Array.Constructor_2.param -->
<!-- UTSJSON.Array.Constructor_2.returnValue -->
<!-- UTSJSON.Array.Constructor_2.compatibility -->
<!-- UTSJSON.Array.Constructor_2.tutorial -->
## 实例属性
### length
...
...
@@ -703,5 +739,3 @@ const shallowCopy = fruits.slice() // this is how to make a copy
```
ts
console
.
log
(
arr
.
0
)
// a syntax error
```
docs/uts/buildin-object-api/date.md
浏览文件 @
1072dd69
...
...
@@ -45,10 +45,46 @@ new Date("Hello")
在Android/IOS平台,会转换为程序执行时的时间
```
ts
// 当前日期:[Date] Fri May 31 2024 17:18:02 GMT+0800
// 当前日期:[Date] Fri May 31 2024 17:18:02 GMT+0800
new
Date
(
"
Hello
"
)
```
### Constructor()
<!-- UTSJSON.Date.Constructor.description -->
<!-- UTSJSON.Date.Constructor.param -->
<!-- UTSJSON.Date.Constructor.returnValue -->
<!-- UTSJSON.Date.Constructor.compatibility -->
<!-- UTSJSON.Date.Constructor.tutorial -->
### Constructor(value)_1
<!-- UTSJSON.Date.Constructor_1.description -->
<!-- UTSJSON.Date.Constructor_1.param -->
<!-- UTSJSON.Date.Constructor_1.returnValue -->
<!-- UTSJSON.Date.Constructor_1.compatibility -->
<!-- UTSJSON.Date.Constructor_1.tutorial -->
### Constructor(year, monthIndex, date?, hours?, minutes?, seconds?, ms?)_2
<!-- UTSJSON.Date.Constructor_2.description -->
<!-- UTSJSON.Date.Constructor_2.param -->
<!-- UTSJSON.Date.Constructor_2.returnValue -->
<!-- UTSJSON.Date.Constructor_2.compatibility -->
<!-- UTSJSON.Date.Constructor_2.tutorial -->
## 静态方法
...
...
docs/uts/buildin-object-api/map.md
浏览文件 @
1072dd69
...
...
@@ -12,6 +12,30 @@ console.log(map['key1']) // 不跨端的用法
console
.
log
(
map
.
get
(
'
key1
'
))
// 跨端用法
```
### Constructor()
<!-- UTSJSON.Map.Constructor.description -->
<!-- UTSJSON.Map.Constructor.param -->
<!-- UTSJSON.Map.Constructor.returnValue -->
<!-- UTSJSON.Map.Constructor.compatibility -->
<!-- UTSJSON.Map.Constructor.tutorial -->
### Constructor(entries?)_1
<!-- UTSJSON.Map.Constructor_1.description -->
<!-- UTSJSON.Map.Constructor_1.param -->
<!-- UTSJSON.Map.Constructor_1.returnValue -->
<!-- UTSJSON.Map.Constructor_1.compatibility -->
<!-- UTSJSON.Map.Constructor_1.tutorial -->
## 实例属性
...
...
@@ -95,7 +119,7 @@ console.log(map1.has('bar'));
let
mapObj
=
new
Map
<
string
,
any
>
()
mapObj
.
put
(
"
name
"
,
"
zhangsan
"
)
mapObj
.
put
(
"
age
"
,
12
)
// 需要特别注意迭代方法的第一个参数是value.第二个是key.
// 需要特别注意迭代方法的第一个参数是value.第二个是key.
mapObj
.
forEach
(
function
(
value
:
any
,
key
:
string
){
console
.
log
(
key
)
console
.
log
(
value
)
...
...
docs/uts/buildin-object-api/number.md
浏览文件 @
1072dd69
...
...
@@ -4,6 +4,19 @@
Number 对象是经过封装的能让你处理数字值的对象。
### Constructor(value?)
<!-- UTSJSON.Number.Constructor.description -->
<!-- UTSJSON.Number.Constructor.param -->
<!-- UTSJSON.Number.Constructor.returnValue -->
<!-- UTSJSON.Number.Constructor.compatibility -->
<!-- UTSJSON.Number.Constructor.tutorial -->
## 实例方法
...
...
docs/uts/buildin-object-api/regexp.md
浏览文件 @
1072dd69
...
...
@@ -2,6 +2,30 @@
RegExp 对象用于将文本与一个模式匹配。
### Constructor(pattern)
<!-- UTSJSON.RegExp.Constructor.description -->
<!-- UTSJSON.RegExp.Constructor.param -->
<!-- UTSJSON.RegExp.Constructor.returnValue -->
<!-- UTSJSON.RegExp.Constructor.compatibility -->
<!-- UTSJSON.RegExp.Constructor.tutorial -->
### Constructor(pattern, flags?)_1
<!-- UTSJSON.RegExp.Constructor_1.description -->
<!-- UTSJSON.RegExp.Constructor_1.param -->
<!-- UTSJSON.RegExp.Constructor_1.returnValue -->
<!-- UTSJSON.RegExp.Constructor_1.compatibility -->
<!-- UTSJSON.RegExp.Constructor_1.tutorial -->
## 实例属性
...
...
@@ -161,4 +185,4 @@ console.log(globalRegex.test(str));
## Bug & Tips@tips
*
目前 RegExp 类型编译到 kotlin 为 io.dcloud.uts.UTSRegExp
\ No newline at end of file
*
目前 RegExp 类型编译到 kotlin 为 io.dcloud.uts.UTSRegExp
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录