mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-24 18:36:51 +08:00
docs(Image): use composition api
This commit is contained in:
parent
8d1096e646
commit
2e9011533a
@ -58,31 +58,36 @@
|
|||||||
</demo-block>
|
</demo-block>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script lang="ts">
|
||||||
export default {
|
import { useTranslate } from '@demo/use-translate';
|
||||||
i18n: {
|
|
||||||
'zh-CN': {
|
const i18n = {
|
||||||
fitMode: '填充模式',
|
'zh-CN': {
|
||||||
round: '圆形图片',
|
fitMode: '填充模式',
|
||||||
loading: '加载中提示',
|
round: '圆形图片',
|
||||||
error: '加载失败提示',
|
loading: '加载中提示',
|
||||||
defaultTip: '默认提示',
|
error: '加载失败提示',
|
||||||
customTip: '自定义提示',
|
defaultTip: '默认提示',
|
||||||
loadFail: '加载失败',
|
customTip: '自定义提示',
|
||||||
},
|
loadFail: '加载失败',
|
||||||
'en-US': {
|
},
|
||||||
fitMode: 'Fit Mode',
|
'en-US': {
|
||||||
round: 'Round',
|
fitMode: 'Fit Mode',
|
||||||
loading: 'Loading',
|
round: 'Round',
|
||||||
error: 'Error',
|
loading: 'Loading',
|
||||||
defaultTip: 'Default Tip',
|
error: 'Error',
|
||||||
customTip: 'Custom Tip',
|
defaultTip: 'Default Tip',
|
||||||
loadFail: 'Load failed',
|
customTip: 'Custom Tip',
|
||||||
},
|
loadFail: 'Load failed',
|
||||||
},
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
export default {
|
||||||
|
setup() {
|
||||||
|
const t = useTranslate(i18n);
|
||||||
|
|
||||||
data() {
|
|
||||||
return {
|
return {
|
||||||
|
t,
|
||||||
image: 'https://img.yzcdn.cn/vant/cat.jpeg',
|
image: 'https://img.yzcdn.cn/vant/cat.jpeg',
|
||||||
fits: ['contain', 'cover', 'fill', 'none', 'scale-down'],
|
fits: ['contain', 'cover', 'fill', 'none', 'scale-down'],
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user