var tmpl=`
  <el-button-group>
    <template v-if="!isForm">
        <el-button v-if="item.isOnGrid" :class="colorState[item.key]" style="border-radius:0px;"  :ref="item.key"   v-for="(item, index) in btns" @click="onfocus(item.key,item.title)"  :icon="item.icon" :type="item.type"  :key="item.key" >
          {{ item.title }}
        </el-button>
    </template>
    <template v-else>
        <el-button v-if="item.isOnForm" :class="colorState[item.key]" style="border-radius:0px;" :ref="item.key"   v-for="(item, index) in btns" @click="onfocus(item.key,item.title)"  :icon="item.icon" :type="item.type"  :key="item.key" >
          {{ item.title }}
        </el-button>
    </template>
  </el-button-group>
`
module.exports=
`{
   template:'${tmpl}',
   props:["isForm","btns","ikey"],
   data:function(){
     var me=self;
     var tmp={};
     tmp[this.ikey]={activeColor:true};
     console.log(tmp);
     return {
       colorState:tmp
     };
   },
   methods:{
      onfocus:function(key,title){
        for(var k in this.colorState){
           this.colorState[k]={activeColor:false};
        }
        this.colorState[key]={activeColor:true};
        console.log(this.colorState);
        this.$emit("select",key,title);
      }
   },

   vname:"gsb-button-group"
}`
