[new feature] ImagePreview: add index slot (#3157)

This commit is contained in:
neverland
2019-04-15 20:59:00 +08:00
committed by GitHub
parent 8d1c02cfbd
commit ce4e0cc3e9
6 changed files with 92 additions and 18 deletions
+13 -6
View File
@@ -1,12 +1,7 @@
import Vue from 'vue';
import ImagePreview from '..';
import ImagePreviewVue from '../ImagePreview';
import {
mount,
trigger,
triggerDrag,
transitionStub
} from '../../../test/utils';
import { mount, trigger, triggerDrag, transitionStub } from '../../../test/utils';
transitionStub();
@@ -109,3 +104,15 @@ test('zoom', async () => {
expect(wrapper).toMatchSnapshot();
Element.prototype.getBoundingClientRect = getBoundingClientRect;
});
test('index slot', () => {
const wrapper = mount({
template: `
<van-image-preview :value="true">
<template v-slot:index>Custom Index</template>
</van-image-preview>
`
});
expect(wrapper).toMatchSnapshot();
});