docs: fix cdn link (#8023)

This commit is contained in:
neverland
2021-01-27 10:25:07 +08:00
committed by GitHub
parent 07678f2d6b
commit 67d44a0fa5
93 changed files with 267 additions and 250 deletions
+8 -4
View File
@@ -15,7 +15,11 @@ app.use(VanImage);
### Basic Usage
```html
<van-image width="100" height="100" src="https://img.yzcdn.cn/vant/cat.jpeg" />
<van-image
width="100"
height="100"
src="https://img01.yzcdn.cn/vant/cat.jpeg"
/>
```
### Fit Mode
@@ -25,7 +29,7 @@ app.use(VanImage);
width="10rem"
height="10rem"
fit="contain"
src="https://img.yzcdn.cn/vant/cat.jpeg"
src="https://img01.yzcdn.cn/vant/cat.jpeg"
/>
```
@@ -38,7 +42,7 @@ Show round image, it may not works at `fit=contain` and `fit=scale-down`.
round
width="10rem"
height="10rem"
src="https://img.yzcdn.cn/vant/cat.jpeg"
src="https://img01.yzcdn.cn/vant/cat.jpeg"
/>
```
@@ -49,7 +53,7 @@ Show round image, it may not works at `fit=contain` and `fit=scale-down`.
width="100"
height="100"
lazy-load
src="https://img.yzcdn.cn/vant/cat.jpeg"
src="https://img01.yzcdn.cn/vant/cat.jpeg"
/>
```
+10 -6
View File
@@ -21,7 +21,11 @@ app.use(VanImage);
基础用法与原生 `img` 标签一致,可以设置 `src``width``height``alt` 等原生属性。
```html
<van-image width="100" height="100" src="https://img.yzcdn.cn/vant/cat.jpeg" />
<van-image
width="100"
height="100"
src="https://img01.yzcdn.cn/vant/cat.jpeg"
/>
```
### 填充模式
@@ -33,7 +37,7 @@ app.use(VanImage);
width="10rem"
height="10rem"
fit="contain"
src="https://img.yzcdn.cn/vant/cat.jpeg"
src="https://img01.yzcdn.cn/vant/cat.jpeg"
/>
```
@@ -46,7 +50,7 @@ app.use(VanImage);
round
width="10rem"
height="10rem"
src="https://img.yzcdn.cn/vant/cat.jpeg"
src="https://img01.yzcdn.cn/vant/cat.jpeg"
/>
```
@@ -59,7 +63,7 @@ app.use(VanImage);
width="100"
height="100"
lazy-load
src="https://img.yzcdn.cn/vant/cat.jpeg"
src="https://img01.yzcdn.cn/vant/cat.jpeg"
/>
```
@@ -76,7 +80,7 @@ app.use(Lazyload);
`Image` 组件提供了默认的加载中提示,支持通过 `loading` 插槽自定义内容。
```html
<van-image src="https://img.yzcdn.cn/vant/cat.jpeg">
<van-image src="https://img01.yzcdn.cn/vant/cat.jpeg">
<template v-slot:loading>
<van-loading type="spinner" size="20" />
</template>
@@ -88,7 +92,7 @@ app.use(Lazyload);
`Image` 组件提供了默认的加载失败提示,支持通过 `error` 插槽自定义内容。
```html
<van-image src="https://img.yzcdn.cn/vant/cat.jpeg">
<van-image src="https://img01.yzcdn.cn/vant/cat.jpeg">
<template v-slot:error>加载失败</template>
</van-image>
```
+1 -1
View File
@@ -88,7 +88,7 @@ export default {
return {
t,
image: 'https://img.yzcdn.cn/vant/cat.jpeg',
image: 'https://img01.yzcdn.cn/vant/cat.jpeg',
fits: ['contain', 'cover', 'fill', 'none', 'scale-down'],
};
},
+11 -11
View File
@@ -6,7 +6,7 @@ exports[`should render demo and match snapshot 1`] = `
<div class="van-image"
style="width: 100px; height: 100px;"
>
<img src="https://img.yzcdn.cn/vant/cat.jpeg"
<img src="https://img01.yzcdn.cn/vant/cat.jpeg"
class="van-image__img"
>
<div class="van-image__loading">
@@ -24,7 +24,7 @@ exports[`should render demo and match snapshot 1`] = `
<div class="van-image"
style="width: 100%; height: 27vw;"
>
<img src="https://img.yzcdn.cn/vant/cat.jpeg"
<img src="https://img01.yzcdn.cn/vant/cat.jpeg"
class="van-image__img"
style="object-fit: contain;"
>
@@ -43,7 +43,7 @@ exports[`should render demo and match snapshot 1`] = `
<div class="van-image"
style="width: 100%; height: 27vw;"
>
<img src="https://img.yzcdn.cn/vant/cat.jpeg"
<img src="https://img01.yzcdn.cn/vant/cat.jpeg"
class="van-image__img"
style="object-fit: cover;"
>
@@ -62,7 +62,7 @@ exports[`should render demo and match snapshot 1`] = `
<div class="van-image"
style="width: 100%; height: 27vw;"
>
<img src="https://img.yzcdn.cn/vant/cat.jpeg"
<img src="https://img01.yzcdn.cn/vant/cat.jpeg"
class="van-image__img"
style="object-fit: fill;"
>
@@ -81,7 +81,7 @@ exports[`should render demo and match snapshot 1`] = `
<div class="van-image"
style="width: 100%; height: 27vw;"
>
<img src="https://img.yzcdn.cn/vant/cat.jpeg"
<img src="https://img01.yzcdn.cn/vant/cat.jpeg"
class="van-image__img"
style="object-fit: none;"
>
@@ -100,7 +100,7 @@ exports[`should render demo and match snapshot 1`] = `
<div class="van-image"
style="width: 100%; height: 27vw;"
>
<img src="https://img.yzcdn.cn/vant/cat.jpeg"
<img src="https://img01.yzcdn.cn/vant/cat.jpeg"
class="van-image__img"
style="object-fit: scale-down;"
>
@@ -123,7 +123,7 @@ exports[`should render demo and match snapshot 1`] = `
<div class="van-image van-image--round"
style="width: 100%; height: 27vw;"
>
<img src="https://img.yzcdn.cn/vant/cat.jpeg"
<img src="https://img01.yzcdn.cn/vant/cat.jpeg"
class="van-image__img"
style="object-fit: contain;"
>
@@ -142,7 +142,7 @@ exports[`should render demo and match snapshot 1`] = `
<div class="van-image van-image--round"
style="width: 100%; height: 27vw;"
>
<img src="https://img.yzcdn.cn/vant/cat.jpeg"
<img src="https://img01.yzcdn.cn/vant/cat.jpeg"
class="van-image__img"
style="object-fit: cover;"
>
@@ -161,7 +161,7 @@ exports[`should render demo and match snapshot 1`] = `
<div class="van-image van-image--round"
style="width: 100%; height: 27vw;"
>
<img src="https://img.yzcdn.cn/vant/cat.jpeg"
<img src="https://img01.yzcdn.cn/vant/cat.jpeg"
class="van-image__img"
style="object-fit: fill;"
>
@@ -180,7 +180,7 @@ exports[`should render demo and match snapshot 1`] = `
<div class="van-image van-image--round"
style="width: 100%; height: 27vw;"
>
<img src="https://img.yzcdn.cn/vant/cat.jpeg"
<img src="https://img01.yzcdn.cn/vant/cat.jpeg"
class="van-image__img"
style="object-fit: none;"
>
@@ -199,7 +199,7 @@ exports[`should render demo and match snapshot 1`] = `
<div class="van-image van-image--round"
style="width: 100%; height: 27vw;"
>
<img src="https://img.yzcdn.cn/vant/cat.jpeg"
<img src="https://img01.yzcdn.cn/vant/cat.jpeg"
class="van-image__img"
style="object-fit: scale-down;"
>