feat(exception): 增加缺省页自定义图片,样式修改 (#13)

Signed-off-by: MNZhu <zhumaonan@aliyun.com>
This commit is contained in:
jacknan 2023-02-23 14:17:47 +08:00 committed by GitHub
parent 6106c9bd4d
commit e2b1cce6d2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 5 deletions

View File

@ -1,6 +1,11 @@
<template>
<div class="tiny-mobile-exception-demo">
<tiny-exception type="nodata" button-text="自定义按钮文本"></tiny-exception>
<tiny-exception
type="nodata"
button-text="重试"
imageUrl="static/images/planet1.jpg"
message="网络异常,请稍后再试,或者联系管理员给您处理"
></tiny-exception>
</div>
</template>

View File

@ -1,6 +1,6 @@
<template>
<div class="tiny-mobile-exception-demo">
<tiny-exception type="nodata" message="自定义文本内容" @click="test"></tiny-exception>
<tiny-exception type="nodata" message="自定义文本内容" imageUrl="static/images/planet1.jpg" @btn-click="test"></tiny-exception>
</div>
</template>

View File

@ -12,13 +12,14 @@
<template>
<div class="tiny-mobile-exception" :class="exceptionClass">
<div class="tiny-mobile-exception__content">
<div class="tiny-mobile-exception__content-view" :class="['tiny-mobile-exception__content-' + type]"></div>
<img v-if="imageUrl" :src="imageUrl" class="tiny-mobile-exception__image" />
<div v-else class="tiny-mobile-exception__content-view" :class="['tiny-mobile-exception__content-' + type]"></div>
<slot name="content">
<div class="tiny-mobile-exception__content-message">
<div class="main-message">{{ state.message }}</div>
<div v-if="subMessage" class="sub-message">{{ subMessage }}</div>
<slot v-if="type === 'nodata'">
<tiny-button @click="create" type="primary" size="medium" plain> {{ buttonText ? buttonText : t('ui.exception.create') }}</tiny-button>
<tiny-button @click="create" type="primary" size="medium" round> {{ buttonText ? buttonText : t('ui.exception.create') }}</tiny-button>
</slot>
</div>
</slot>
@ -49,7 +50,8 @@ export default {
message: String,
subMessage: String,
exceptionClass: String,
buttonText: String
buttonText: String,
imageUrl: String
},
setup(props, context) {
return setup({ props, context, renderless, api, mono: true })