This commit is contained in:
2025-09-14 00:21:54 +08:00
commit d40b3bbd62
766 changed files with 36275 additions and 0 deletions

View File

@@ -0,0 +1,127 @@
.container {
padding-bottom: 20px;
}
.flex {
display: flex;
}
.flex-wrap {
flex-wrap: wrap;
}
.center {
justify-content: center;
align-items: center;
}
.mb-10 {
margin-bottom: 10px;
}
.mt-10 {
margin-top: 10px;
}
.text-container {
width: 100%;
white-space: pre-line;
margin-bottom: 10px;
}
.box text {
display: block;
padding-top: 10px;
padding-bottom: 10px;
}
.box1 {
width: 300px;
height: 300px;
background-color: red;
margin: 0 auto;
border-radius: 5px;
text-align: center;
}
.box2 {
width: 200px;
height: 200px;
background-color: orange;
margin: 0 auto;
border-radius: 5px;
}
.box3 {
width: 100px;
height: 100px;
background-color: yellow;
margin: 0 auto;
border-radius: 5px;
}
.transitionbox {
width: 200px;
height: 200px;
background-color: grey;
margin: 0 auto;
transition: all 0.3s ease;
border-radius: 5px;
}
.transitionbox:hover {
width: 300px;
/* height: 300px; */
background-color: grey;
margin: 0 auto;
}
@keyframes fadeOutIn {
0% {
opacity: 1;
}
50% {
opacity: 0;
}
100% {
opacity: 1;
}
}
.animationbox {
width: 200px;
height: 200px;
background-color: khaki;
margin: 0 auto;
border-radius: 5px;
}
.animation {
animation: fadeOutIn 2s ease;
animation-iteration-count: 2;
}
.wrapper {
height: 300px;
width: 100%;
display: flex;
justify-content: center;
align-items: center;
border-radius: 5px;
}
.info-panel {
display: flex;
flex-flow: column;
align-items: center;
}
.info-panel > text {
display: block;
margin-bottom: 10px;
}
.info-panel > button {
margin-bottom: 10px;
width: 100%;
}

View File

@@ -0,0 +1,23 @@
Page({
data: {
},
handlePromise(){
return new Promise((_, rej) => {
rej(new Error('promise错误'));
});
},
handleTimer(){
setTimeout(() => {
throw new Error('setTimeout错误');
}, 1000);
},
handleStringError(){
return new Promise((_, rej) => {
rej('promise string错误');
});
},
handleSyncError() {
throw new Error('同步错误');
}
});

View File

@@ -0,0 +1,8 @@
{
"navigationBarTitleText": "error捕获测试",
"disableScroll": true,
"usingComponents": {
"showbox": "../../common/component/showbox/index",
"box": "../../common/component/container/index"
}
}

View File

@@ -0,0 +1,50 @@
<view class="container">
<showbox title="异步错误捕获测试">
<box>
仅安卓开启2.0架构以及chopper engine引擎时支持
<button
class="_ui-button"
hover-class="_ui-button-hover"
bind:tap="handlePromise"
>
promise捕获
</button>
</box>
</showbox>
<showbox title="异步错误捕获测试">
<box>
<button
class="_ui-button"
hover-class="_ui-button-hover"
bind:tap="handleTimer"
>
定时器捕获
</button>
</box>
</showbox>
<showbox title="异步错误捕获测试">
<box>
<button
class="_ui-button"
hover-class="_ui-button-hover"
bind:tap="handleStringError"
>
字符类型业务错误捕获
</button>
</box>
</showbox>
<showbox title="同步错误测试">
<box>
<button
class="_ui-button"
hover-class="_ui-button-hover"
bind:tap="handleSyncError"
>
同步错误测试
</button>
</box>
</showbox>
</view>