mirror of
https://github.com/youzan/vant.git
synced 2025-10-18 09:24:25 +00:00
docs(Image): rename Image to VanImage (#6049)
This commit is contained in:
@@ -4,9 +4,9 @@
|
||||
|
||||
```js
|
||||
import Vue from 'vue';
|
||||
import { Image } from 'vant';
|
||||
import { Image as VanImage } from 'vant';
|
||||
|
||||
Vue.use(Image);
|
||||
Vue.use(VanImage);
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
@@ -8,9 +8,9 @@
|
||||
|
||||
```js
|
||||
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 Image from '..';
|
||||
import VanImage from '..';
|
||||
|
||||
test('click event', () => {
|
||||
const wrapper = mount(Image);
|
||||
const wrapper = mount(VanImage);
|
||||
|
||||
wrapper.trigger('click');
|
||||
expect(wrapper.emitted('click')[0][0]).toBeTruthy();
|
||||
@@ -10,7 +10,7 @@ test('click event', () => {
|
||||
});
|
||||
|
||||
test('load event', () => {
|
||||
const wrapper = mount(Image, {
|
||||
const wrapper = mount(VanImage, {
|
||||
propsData: {
|
||||
src: 'https://img.yzcdn.cn/vant/cat.jpeg',
|
||||
},
|
||||
@@ -26,7 +26,7 @@ test('load event', () => {
|
||||
});
|
||||
|
||||
test('error event', () => {
|
||||
const wrapper = mount(Image, {
|
||||
const wrapper = mount(VanImage, {
|
||||
propsData: {
|
||||
src: 'https://img.yzcdn.cn/vant/cat.jpeg',
|
||||
},
|
||||
@@ -38,7 +38,7 @@ test('error event', () => {
|
||||
});
|
||||
|
||||
test('lazy load', () => {
|
||||
const wrapper = mount(Image, {
|
||||
const wrapper = mount(VanImage, {
|
||||
propsData: {
|
||||
src: 'https://img.yzcdn.cn/vant/cat.jpeg',
|
||||
lazyLoad: true,
|
||||
@@ -49,7 +49,7 @@ test('lazy load', () => {
|
||||
});
|
||||
|
||||
test('lazy-load load event', (done) => {
|
||||
const wrapper = mount(Image, {
|
||||
const wrapper = mount(VanImage, {
|
||||
propsData: {
|
||||
lazyLoad: true,
|
||||
src: 'https://img.yzcdn.cn/vant/cat.jpeg',
|
||||
@@ -76,7 +76,7 @@ test('lazy-load load event', (done) => {
|
||||
});
|
||||
|
||||
test('lazy-load error event', (done) => {
|
||||
const wrapper = mount(Image, {
|
||||
const wrapper = mount(VanImage, {
|
||||
propsData: {
|
||||
lazyLoad: true,
|
||||
},
|
||||
@@ -102,7 +102,7 @@ test('lazy-load error event', (done) => {
|
||||
});
|
||||
|
||||
test('show-loading prop', () => {
|
||||
const wrapper = mount(Image, {
|
||||
const wrapper = mount(VanImage, {
|
||||
propsData: {
|
||||
showLoading: false,
|
||||
},
|
||||
@@ -112,7 +112,7 @@ test('show-loading prop', () => {
|
||||
});
|
||||
|
||||
test('show-error prop', () => {
|
||||
const wrapper = mount(Image, {
|
||||
const wrapper = mount(VanImage, {
|
||||
propsData: {
|
||||
showError: false,
|
||||
src: 'https://img.yzcdn.cn/vant/cat.jpeg',
|
||||
@@ -125,7 +125,7 @@ test('show-error prop', () => {
|
||||
});
|
||||
|
||||
test('error-icon prop', () => {
|
||||
const wrapper = mount(Image, {
|
||||
const wrapper = mount(VanImage, {
|
||||
propsData: {
|
||||
errorIcon: 'error',
|
||||
src: 'https://img.yzcdn.cn/vant/cat.jpeg',
|
||||
@@ -138,7 +138,7 @@ test('error-icon prop', () => {
|
||||
});
|
||||
|
||||
test('loading-icon prop', () => {
|
||||
const wrapper = mount(Image, {
|
||||
const wrapper = mount(VanImage, {
|
||||
propsData: {
|
||||
loadingIcon: 'success',
|
||||
},
|
||||
@@ -148,7 +148,7 @@ test('loading-icon prop', () => {
|
||||
});
|
||||
|
||||
test('radius prop', () => {
|
||||
const wrapper = mount(Image, {
|
||||
const wrapper = mount(VanImage, {
|
||||
propsData: {
|
||||
radius: 3,
|
||||
src: 'https://img.yzcdn.cn/vant/cat.jpeg',
|
||||
|
Reference in New Issue
Block a user