国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

javascript - Implementing list radio selection (style change) in vuejs
PHPz
PHPz 2017-06-05 11:13:43
0
2
1291

Initially select the first one

But now select another one that is selected without unchecking the style

code show as below

What is the problem? My understanding is that after changing the clickindex, the interface is re-rendered, and then the normal style will be given to other cells if the index and clickindex are not equal, but it does not seem to be the case.

PHPz
PHPz

學(xué)習(xí)是最好的投資!

reply all(2)
洪濤

This clickindex and this.index are both on the list item component, right? So the problems caused.

You should save the clickindex on the list component, and then pass it into the list item through props. The click event should bubble up to the list component, and then let the list component modify clickindex.

巴扎黑

vue uses data-driven view methods: {

  incrementTotal: function (a) {
      for(let i=0;i<this.list.length;i++){
           if(i==(a-1)){
             this.list[i].Active=true
           }else {
             this.list[i].Active=false
           }
      }
  }
  這事我寫(xiě)的方法
  
  
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template