forked from opentiny/tiny-vue
feat(exception): 增加缺省页自定义图片,样式修改 (#13)
Signed-off-by: MNZhu <zhumaonan@aliyun.com>
This commit is contained in:
parent
6106c9bd4d
commit
e2b1cce6d2
|
@ -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>
|
||||
|
||||
|
|
|
@ -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>
|
||||
|
||||
|
|
|
@ -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 })
|
||||
|
|
Loading…
Reference in New Issue