mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
docs(Image): rename Image to VanImage (#6049)
This commit is contained in:
parent
4d0281018a
commit
43777e7da9
@ -4,9 +4,9 @@
|
|||||||
|
|
||||||
```js
|
```js
|
||||||
import Vue from 'vue';
|
import Vue from 'vue';
|
||||||
import { Image } from 'vant';
|
import { Image as VanImage } from 'vant';
|
||||||
|
|
||||||
Vue.use(Image);
|
Vue.use(VanImage);
|
||||||
```
|
```
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
@ -8,9 +8,9 @@
|
|||||||
|
|
||||||
```js
|
```js
|
||||||
import Vue from 'vue';
|
import Vue from 'vue';
|
||||||
import { Image } from 'vant';
|
import { Image as VanImage } from 'vant';
|
||||||
|
|
||||||
Vue.use(Image);
|
Vue.use(VanImage);
|
||||||
```
|
```
|
||||||
|
|
||||||
## 代码演示
|
## 代码演示
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
import { mount } from '../../../test';
|
import { mount } from '../../../test';
|
||||||
import Image from '..';
|
import VanImage from '..';
|
||||||
|
|
||||||
test('click event', () => {
|
test('click event', () => {
|
||||||
const wrapper = mount(Image);
|
const wrapper = mount(VanImage);
|
||||||
|
|
||||||
wrapper.trigger('click');
|
wrapper.trigger('click');
|
||||||
expect(wrapper.emitted('click')[0][0]).toBeTruthy();
|
expect(wrapper.emitted('click')[0][0]).toBeTruthy();
|
||||||
@ -10,7 +10,7 @@ test('click event', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test('load event', () => {
|
test('load event', () => {
|
||||||
const wrapper = mount(Image, {
|
const wrapper = mount(VanImage, {
|
||||||
propsData: {
|
propsData: {
|
||||||
src: 'https://img.yzcdn.cn/vant/cat.jpeg',
|
src: 'https://img.yzcdn.cn/vant/cat.jpeg',
|
||||||
},
|
},
|
||||||
@ -26,7 +26,7 @@ test('load event', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test('error event', () => {
|
test('error event', () => {
|
||||||
const wrapper = mount(Image, {
|
const wrapper = mount(VanImage, {
|
||||||
propsData: {
|
propsData: {
|
||||||
src: 'https://img.yzcdn.cn/vant/cat.jpeg',
|
src: 'https://img.yzcdn.cn/vant/cat.jpeg',
|
||||||
},
|
},
|
||||||
@ -38,7 +38,7 @@ test('error event', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test('lazy load', () => {
|
test('lazy load', () => {
|
||||||
const wrapper = mount(Image, {
|
const wrapper = mount(VanImage, {
|
||||||
propsData: {
|
propsData: {
|
||||||
src: 'https://img.yzcdn.cn/vant/cat.jpeg',
|
src: 'https://img.yzcdn.cn/vant/cat.jpeg',
|
||||||
lazyLoad: true,
|
lazyLoad: true,
|
||||||
@ -49,7 +49,7 @@ test('lazy load', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test('lazy-load load event', (done) => {
|
test('lazy-load load event', (done) => {
|
||||||
const wrapper = mount(Image, {
|
const wrapper = mount(VanImage, {
|
||||||
propsData: {
|
propsData: {
|
||||||
lazyLoad: true,
|
lazyLoad: true,
|
||||||
src: 'https://img.yzcdn.cn/vant/cat.jpeg',
|
src: 'https://img.yzcdn.cn/vant/cat.jpeg',
|
||||||
@ -76,7 +76,7 @@ test('lazy-load load event', (done) => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test('lazy-load error event', (done) => {
|
test('lazy-load error event', (done) => {
|
||||||
const wrapper = mount(Image, {
|
const wrapper = mount(VanImage, {
|
||||||
propsData: {
|
propsData: {
|
||||||
lazyLoad: true,
|
lazyLoad: true,
|
||||||
},
|
},
|
||||||
@ -102,7 +102,7 @@ test('lazy-load error event', (done) => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test('show-loading prop', () => {
|
test('show-loading prop', () => {
|
||||||
const wrapper = mount(Image, {
|
const wrapper = mount(VanImage, {
|
||||||
propsData: {
|
propsData: {
|
||||||
showLoading: false,
|
showLoading: false,
|
||||||
},
|
},
|
||||||
@ -112,7 +112,7 @@ test('show-loading prop', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test('show-error prop', () => {
|
test('show-error prop', () => {
|
||||||
const wrapper = mount(Image, {
|
const wrapper = mount(VanImage, {
|
||||||
propsData: {
|
propsData: {
|
||||||
showError: false,
|
showError: false,
|
||||||
src: 'https://img.yzcdn.cn/vant/cat.jpeg',
|
src: 'https://img.yzcdn.cn/vant/cat.jpeg',
|
||||||
@ -125,7 +125,7 @@ test('show-error prop', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test('error-icon prop', () => {
|
test('error-icon prop', () => {
|
||||||
const wrapper = mount(Image, {
|
const wrapper = mount(VanImage, {
|
||||||
propsData: {
|
propsData: {
|
||||||
errorIcon: 'error',
|
errorIcon: 'error',
|
||||||
src: 'https://img.yzcdn.cn/vant/cat.jpeg',
|
src: 'https://img.yzcdn.cn/vant/cat.jpeg',
|
||||||
@ -138,7 +138,7 @@ test('error-icon prop', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test('loading-icon prop', () => {
|
test('loading-icon prop', () => {
|
||||||
const wrapper = mount(Image, {
|
const wrapper = mount(VanImage, {
|
||||||
propsData: {
|
propsData: {
|
||||||
loadingIcon: 'success',
|
loadingIcon: 'success',
|
||||||
},
|
},
|
||||||
@ -148,7 +148,7 @@ test('loading-icon prop', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test('radius prop', () => {
|
test('radius prop', () => {
|
||||||
const wrapper = mount(Image, {
|
const wrapper = mount(VanImage, {
|
||||||
propsData: {
|
propsData: {
|
||||||
radius: 3,
|
radius: 3,
|
||||||
src: 'https://img.yzcdn.cn/vant/cat.jpeg',
|
src: 'https://img.yzcdn.cn/vant/cat.jpeg',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user