mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
[bugfix] ImagePreview: start position (#1456)
This commit is contained in:
parent
ac092e877e
commit
2c8ee2ac3e
@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<div
|
<div
|
||||||
v-show="value"
|
v-if="value"
|
||||||
:class="b()"
|
:class="b()"
|
||||||
@touchstart="onTouchStart"
|
@touchstart="onTouchStart"
|
||||||
@touchend="onTouchEnd"
|
@touchend="onTouchEnd"
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||||
|
|
||||||
exports[`render image 1`] = `
|
exports[`render image 1`] = `
|
||||||
<div class="van-image-preview" style="display: none;">
|
<div class="van-image-preview">
|
||||||
<div class="van-swipe">
|
<div class="van-swipe">
|
||||||
<div class="van-swipe__track" style="width: 0px;">
|
<div class="van-swipe__track" style="width: 0px;">
|
||||||
<div class="van-swipe-item" style="width: 0px; height: 100%;">
|
<div class="van-swipe-item" style="width: 0px; height: 100%;">
|
||||||
|
@ -11,7 +11,7 @@ const images = [
|
|||||||
|
|
||||||
test('render image', () => {
|
test('render image', () => {
|
||||||
const wrapper = mount(ImagePreviewVue, {
|
const wrapper = mount(ImagePreviewVue, {
|
||||||
propsData: { images }
|
propsData: { images, value: true }
|
||||||
});
|
});
|
||||||
|
|
||||||
expect(wrapper).toMatchSnapshot();
|
expect(wrapper).toMatchSnapshot();
|
||||||
@ -23,7 +23,7 @@ test('render image', () => {
|
|||||||
expect(wrapper.emitted('input')[0][0]).toBeFalsy();
|
expect(wrapper.emitted('input')[0][0]).toBeFalsy();
|
||||||
});
|
});
|
||||||
|
|
||||||
test('function call', (done) => {
|
test('function call', done => {
|
||||||
ImagePreview(images);
|
ImagePreview(images);
|
||||||
ImagePreview(images.slice(0, 1));
|
ImagePreview(images.slice(0, 1));
|
||||||
Vue.nextTick(() => {
|
Vue.nextTick(() => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user