vant icon indicating copy to clipboard operation
vant copied to clipboard

When 'showIndicators' set to 'false' The second image does not show

Open oddonet opened this issue 9 years ago • 4 comments

请认真写 PR 的标题,会用于生成 change log。

Do you want to request a feature or report a bug?

What is the current behavior? When 'showIndicators' set to 'false' The second image in demo disappears.

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem via https://jsfiddle.net or similar (template: https://jsfiddle.net/n879nke7/). Please refer to issue #79 for setup

What is the expected behavior? The 'showIndicators' parameter shouldn't impact display of swipe images.

Which versions of Vant and Vue, and which browser / OS are affected by this issue? Did this work in previous versions of Vant? vant: 0.8.4 vue: 2.8.2

oddonet avatar Aug 19 '17 00:08 oddonet

The issue, apparently, is related to lazyLoad. If change the image src attribute to 'src' instead of 'v-lazy' then it works fine.

oddonet avatar Aug 19 '17 01:08 oddonet

sometime swipe image will change to drag image, this bug is fixed in #81 v-lazy seems to work correctly, you can try the second demo in this page -> demo page

pangxie1991 avatar Aug 19 '17 04:08 pangxie1991

Thanks for the quick turn around. However, the issue has not yet been resolved.

I was using 'autoPlay' and it is still not working after I implemented your fix. Please see the the html in chrome dev-tool as below:

<div id="slider">
    <div class="van-swipe">
        <div class="van-swipe__items">
            <div class="van-swipe-item"
                 style="position: absolute; top: 0px; left: 0px; width: 100%; height: 100%; transform: translate3d(398px, 0px, 0px); display: block;">
                <img alt="" src="https://img.yzcdn.cn/upload_files/2017/03/09/FvkZahKoq1vkxLQFdVWeLf2UCqDz.png"
                     lazy="loaded"></div>
            <div class="van-swipe-item"
                 style="position: absolute; top: 0px; left: 0px; width: 100%; height: 100%; transform: translate3d(0px, 0px, 0px); display: block;">
                <img alt="" src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"
                     lazy="loading">
        </div>
        </div><!----></div>
</div>

Notice the image source for the second image is not what is intended. And also the lazy loading is stuck in the loading process.

oddonet avatar Aug 19 '17 05:08 oddonet

actually the v-lazy directly use the vue-lazyload. i tried this in my chrome and it work correctly.

maybe you can change the img src to another url. img.yzcdn.cn <- this cdn is mainly focused on china mainland, sometimes not available abroad.

pangxie1991 avatar Aug 19 '17 14:08 pangxie1991