<template>
  <view>
    <label v-for="(item,index)  in items" :key="item.value">
      <view>
        <changecarCar val="item.name" :index="index" data-current="item.id" :ids="items" v-on:pChangeType="select"></changecarCar>
      </view>
    </label>
  </view>  
</template>

<script>
import changecarCar from "../../components/changecar/changecar-car";
export default {
  components: {
    changecarCar
  },
  data() {
    return {
      items: [
        {
          value: "USA",
          name: "美国",
          id: 0
        },
        {
          value: "CHN",
          name: "中国",
          checked: "true",
          id: 1
        },
        {
          value: "BRA",
          name: "巴西",
          id: 2
        }
      ],
      current: 0
    };
  },
  methods: {
    onLoad() {

    },
     xz: function(e) {
      console.log(1111);    
      console.log(e)
      for (var i = 0; i < this.items.length; i++) {
        console.log(i == e.currentTarget.dataset.current)
        
        // if (i == this.current) {
        //   this.ifxz = true;
        //   console.log(552);
        // }else{
        //   this.ifxz=fasle
        // }
      }
    },
    select(){
      console.log(200)
    }
  }
};
</script>

<style>
</style>