The control box to show hidden layer and change the internal image src, first displayed on a map will then switch

<div class="cart" v-show="cart">
    <div class="cart-content">
        <img :src="imgUrl" />
    </div>
</div>
// display contents and switching cards 
showCart (I) {
   // not solve the problem
   //this.imgUrl = '';
the this .imgUrl = the this .url [I]; the this .cart = to true ; },
// hide card closeCard () {
the this .cart = to false ; },

These are the problems in your code

1. Use the v-if, without v-show, brings frequent switching consumption

2. After you hide empty card imgUrl

closeCard(){
  this.card = false;
  this.imgUrl = '';        
}

3. Use multiple cards (recommended)

 

Guess you like

Origin www.cnblogs.com/223zzm/p/11666547.html