Skip to content

Commit

Permalink
fix(exception): modify mobile problem (#2690)
Browse files Browse the repository at this point in the history
  • Loading branch information
James-9696 authored Dec 25, 2024
1 parent 5b243c2 commit a86fffc
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 19 deletions.
7 changes: 1 addition & 6 deletions examples/sites/demos/mobile/app/exception/buttonText.vue
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
<template>
<div class="tiny-mobile-exception-demo">
<tiny-exception
type="nodata"
button-text="重试"
:imageUrl="imageUrl"
message="网络异常,请稍后再试,或者联系管理员给您处理"
></tiny-exception>
<tiny-exception type="nodata" button-text="重试" :imageUrl="imageUrl"></tiny-exception>
</div>
</template>

Expand Down
20 changes: 12 additions & 8 deletions examples/sites/demos/mobile/app/exception/exceptionClass.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,31 @@
type="nodata"
button-text="重试"
:imageUrl="imageUrl"
:exception-class="exceptionClass"
message="网络异常,请稍后再试,或者联系管理员给您处理"
></tiny-exception>
</div>
</template>

<script lang="jsx">
import { TinyException } from '@opentiny/vue-mobile'
import { Exception } from '@opentiny/vue'
export default {
components: {
TinyException
TinyException: Exception
},
data() {
return {
imageUrl: `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/planet1.jpg`
imageUrl: `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/planet1.jpg`,
exceptionClass: 'no-problem'
}
},
methods: {
test() {
alert(11)
}
}
methods: {}
}
</script>

<style lang="less">
.no-problem {
background-color: pink;
}
</style>
6 changes: 2 additions & 4 deletions examples/sites/demos/mobile/app/exception/message.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<div class="tiny-mobile-exception-demo">
<tiny-exception type="nodata" message="自定义文本内容" :imageUrl="imageUrl" @btn-click="test"></tiny-exception>
<tiny-exception type="nodata" message="自定义文本内容" @btn-click="test"></tiny-exception>
</div>
</template>

Expand All @@ -12,9 +12,7 @@ export default {
TinyException
},
data() {
return {
imageUrl: `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/planet1.jpg`
}
return {}
},
methods: {
test() {
Expand Down
1 change: 1 addition & 0 deletions packages/mobile/components/exception/src/exception.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ export const exceptionProps = {
type: String,
default: 'nodata'
},
buttonText: String,
message: String,
subMessage: String,
exceptionClass: String,
Expand Down
2 changes: 1 addition & 1 deletion packages/mobile/components/exception/src/mobile.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<slot name="content">
<div class="tiny-mobile-exception__content-message">
<div class="main-message">
{{ state.message }}
{{ message }}
</div>
<div v-if="subMessage" class="sub-message">
{{ subMessage }}
Expand Down

0 comments on commit a86fffc

Please sign in to comment.