mirror of
https://github.com/youzan/vant.git
synced 2025-10-20 18:54:24 +00:00
[new feature] Image: add loading slot
This commit is contained in:
@@ -19,6 +19,7 @@
|
||||
>
|
||||
<van-image
|
||||
:fit="fit"
|
||||
width="100%"
|
||||
height="27vw"
|
||||
:src="image"
|
||||
/>
|
||||
@@ -26,6 +27,33 @@
|
||||
</van-col>
|
||||
</van-row>
|
||||
</demo-block>
|
||||
|
||||
<demo-block :title="$t('loading')">
|
||||
<van-row gutter="20">
|
||||
<van-col span="8">
|
||||
<van-image
|
||||
width="100%"
|
||||
height="27vw"
|
||||
/>
|
||||
<div class="text">{{ $t('defaultTip') }}</div>
|
||||
</van-col>
|
||||
|
||||
<van-col span="8">
|
||||
<van-image
|
||||
width="100%"
|
||||
height="27vw"
|
||||
>
|
||||
<template v-slot:loading>
|
||||
<van-loading
|
||||
type="spinner"
|
||||
size="20"
|
||||
/>
|
||||
</template>
|
||||
</van-image>
|
||||
<div class="text">{{ $t('customTip') }}</div>
|
||||
</van-col>
|
||||
</van-row>
|
||||
</demo-block>
|
||||
</demo-section>
|
||||
</template>
|
||||
|
||||
@@ -33,10 +61,18 @@
|
||||
export default {
|
||||
i18n: {
|
||||
'zh-CN': {
|
||||
fitMode: '缩放模式'
|
||||
fitMode: '填充模式',
|
||||
loading: '加载中提示',
|
||||
error: '加载失败提示',
|
||||
defaultTip: '默认提示',
|
||||
customTip: '自定义提示'
|
||||
},
|
||||
'en-US': {
|
||||
fitMode: 'Fit Mode'
|
||||
fitMode: 'Fit Mode',
|
||||
loading: 'Loading',
|
||||
error: 'Error',
|
||||
defaultTip: 'Default Tip',
|
||||
customTip: 'Custom Tip'
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user