[bugfix] ImagePreview: start position (#1456)

This commit is contained in:
neverland 2018-07-10 21:13:55 +08:00 committed by GitHub
parent ac092e877e
commit 2c8ee2ac3e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 4 deletions

View File

@ -1,6 +1,6 @@
<template>
<div
v-show="value"
v-if="value"
:class="b()"
@touchstart="onTouchStart"
@touchend="onTouchEnd"

View File

@ -1,7 +1,7 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
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__track" style="width: 0px;">
<div class="van-swipe-item" style="width: 0px; height: 100%;">

View File

@ -11,7 +11,7 @@ const images = [
test('render image', () => {
const wrapper = mount(ImagePreviewVue, {
propsData: { images }
propsData: { images, value: true }
});
expect(wrapper).toMatchSnapshot();
@ -23,7 +23,7 @@ test('render image', () => {
expect(wrapper.emitted('input')[0][0]).toBeFalsy();
});
test('function call', (done) => {
test('function call', done => {
ImagePreview(images);
ImagePreview(images.slice(0, 1));
Vue.nextTick(() => {