Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
hello-uvue
提交
d09b49ff
H
hello-uvue
项目概览
DCloud
/
hello-uvue
通知
367
Star
3
Fork
8
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
H
hello-uvue
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
d09b49ff
编写于
4月 23, 2024
作者:
DCloud-WZF
💬
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat: 补充运行时异常示例及测试
上级
e97f6bc6
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
118 addition
and
30 deletion
+118
-30
pages.json
pages.json
+18
-6
pages/error/runtime-error/runtime-error-composition.uvue
pages/error/runtime-error/runtime-error-composition.uvue
+9
-0
pages/error/runtime-error/runtime-error-options.uvue
pages/error/runtime-error/runtime-error-options.uvue
+15
-0
pages/error/runtime-error/runtime-error.test.js
pages/error/runtime-error/runtime-error.test.js
+21
-0
pages/tab-bar/composition-api.uvue
pages/tab-bar/composition-api.uvue
+21
-2
pages/tab-bar/options-api.uvue
pages/tab-bar/options-api.uvue
+34
-22
未找到文件。
pages.json
浏览文件 @
d09b49ff
...
...
@@ -78,12 +78,12 @@
"navigationBarTitleText"
:
"v-bind-set"
}
},
//
#ifdef
WEB
{
"path"
:
"pages/directive/v-bind/v-bind-css"
,
"style"
:
{
"navigationBarTitleText"
:
"v-bind-css"
}
//
#ifdef
WEB
{
"path"
:
"pages/directive/v-bind/v-bind-css"
,
"style"
:
{
"navigationBarTitleText"
:
"v-bind-css"
}
},
//
#endif
{
...
...
@@ -670,6 +670,18 @@
"navigationBarTitleText"
:
""
,
"enablePullDownRefresh"
:
false
}
},
{
"path"
:
"pages/error/runtime-error/runtime-error-options"
,
"style"
:
{
"navigationBarTitleText"
:
"runtime error 选项式 API"
}
},
{
"path"
:
"pages/error/runtime-error/runtime-error-composition"
,
"style"
:
{
"navigationBarTitleText"
:
"runtime error 组合式 API"
}
}
],
"tabBar"
:
{
...
...
pages/error/runtime-error/runtime-error-composition.uvue
0 → 100644
浏览文件 @
d09b49ff
<template>
<view class="page">
<text>{{ arr[1] }}</text>
</view>
</template>
<script setup lang="uts">
const arr = [0]
</script>
pages/error/runtime-error/runtime-error-options.uvue
0 → 100644
浏览文件 @
d09b49ff
<template>
<view class="page">
<text>{{ arr[1] }}</text>
</view>
</template>
<script lang="uts">
export default {
data(){
return {
arr: [0]
}
}
}
</script>
pages/error/runtime-error/runtime-error.test.js
0 → 100644
浏览文件 @
d09b49ff
const
OPTIONS_PAGE_PATH
=
'
/pages/error/runtime-error/runtime-error-options
'
const
COMPOSITION_PAGE_PATH
=
'
/pages/error/runtime-error/runtime-error-composition
'
const
HOME_PAGE
=
'
/pages/tab-bar/options-api
'
describe
(
'
运行时异常
'
,
()
=>
{
let
page
const
test
=
async
(
pagePath
)
=>
{
page
=
await
program
.
reLaunch
(
pagePath
)
await
page
.
waitFor
(
1000
)
expect
(
page
.
path
).
toBe
(
pagePath
.
substring
(
1
))
page
=
await
program
.
switchTab
(
HOME_PAGE
)
await
page
.
waitFor
(
1000
)
expect
(
page
.
path
).
toBe
(
HOME_PAGE
.
substring
(
1
))
}
it
(
'
数组下标越位 options API
'
,
async
()
=>
{
await
test
(
OPTIONS_PAGE_PATH
)
})
it
(
'
数组下标越位 composition API
'
,
async
()
=>
{
await
test
(
COMPOSITION_PAGE_PATH
)
})
})
\ No newline at end of file
pages/tab-bar/composition-api.uvue
浏览文件 @
d09b49ff
...
...
@@ -256,7 +256,19 @@
enable: true,
}
]
}
},
{
id: 'error',
name: '异常示例',
open: false,
pages: [
{
name: '运行时异常',
url: 'runtime-error/runtime-error-composition',
enable: true,
}
] as PageItem[],
},
] as PageList[]
const goDetailPage = (id : string, e : PageItem) => {
...
...
@@ -268,7 +280,14 @@
return
}
const url = e.url!.includes('/') ? e.url : `${e.url}/${e.url}`
if(id == 'error'){
uni.navigateTo({
url: `/pages/error/${e.url}`,
})
return
}
const url = e.url!.includes('/') ? e.url : `${e.url}/${e.url}`
uni.navigateTo({
url: `/pages/composition-api/${id}/${url}`,
})
...
...
pages/tab-bar/options-api.uvue
浏览文件 @
d09b49ff
...
...
@@ -64,10 +64,10 @@
name: '内置组件',
open: false,
pages: [
{
name: 'keepAlive',
url: 'keep-alive',
enable: true,
{
name: 'keepAlive',
url: 'keep-alive',
enable: true,
},{
name: 'teleport',
url: 'teleport',
...
...
@@ -171,21 +171,21 @@
name: 'v-bind-attribute',
url: 'v-bind/v-bind-attribute',
enable: false,
},
{
name: 'v-bind-array-deep',
url: 'v-bind/v-bind-array-deep',
enable: true,
},
{
name: 'v-bind-map',
url: 'v-bind/v-bind-map',
enable: true,
},
{
name: 'v-bind-set',
url: 'v-bind/v-bind-set',
enable: true,
},
{
name: 'v-bind-array-deep',
url: 'v-bind/v-bind-array-deep',
enable: true,
},
{
name: 'v-bind-map',
url: 'v-bind/v-bind-map',
enable: true,
},
{
name: 'v-bind-set',
url: 'v-bind/v-bind-set',
enable: true,
},
{
name: 'v-model',
...
...
@@ -425,13 +425,13 @@
url: 'inject',
enable: true,
},
// #ifdef APP
// #ifdef APP
{
name: 'mixins',
url: 'mixins',
enable: true,
},
// #endif
// #endif
// #ifdef WEB
{
name: 'mixins',
...
...
@@ -467,6 +467,18 @@
}
] as PageItem[],
},
{
id: 'error',
name: '异常示例',
open: false,
pages: [
{
name: '运行时异常',
url: 'runtime-error/runtime-error-options',
enable: true,
}
] as PageItem[],
},
] as PageList[],
}
},
...
...
@@ -480,7 +492,7 @@
return
}
const url = e.url!.includes('/') ? e.url : `${e.url}/${e.url}`
const url =
id == 'error' ? e.url :
e.url!.includes('/') ? e.url : `${e.url}/${e.url}`
uni.navigateTo({
url: `/pages/${id}/${url}`,
})
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录