var tmpl=`
<div>
    <el-radio-group :value="value"  @change="onChange" v-model="rdo" size="small">
        <template v-if="!isButton">
            <el-radio v-for="item in radioMetaDatas" :label="item.key" :key="item.key">{{item.content}}</el-radio>
        </template>
        <template v-else>
            <el-radio-button v-for="item in radioMetaDatas"  :label="item.key" :key="item.key">
               {{item.content}}
            </el-radio-button>
        </template>
    </el-radio-group>
    </div>
`
module.exports=
`{
   template:'${tmpl}',
   model:{
     prop:"value",
     event:"change"
   },
   props:['value',"dicKey","isButton","size"],
   data:function(){
     return {
       radioMetaDatas:[
       ],
       rdo:this.value
     };
   },
   mounted:function(){

   },
   watch:{
     value:function(v){
        this.rdo=v;
     }
   },
   created:function(){
      this.fetchMetaDatas();
   },
   methods:{
     onChange(v){
       console.log(v);
       this.$emit("change",v);
     },
     fetchMetaDatas:function(){
       this.$root.getReq("/web/metaCtl/getDicConfig",{"dicKey":this.dicKey}).then(cfg=>{
          console.log(JSON.stringify(cfg.data),"xxxxxxxxxxxxxxxxxxxxx");
          Object.keys(cfg.data).forEach(key=>{
             this.radioMetaDatas.push({"key":key,"content":cfg.data[key]});
          });
       });
     },
   },
   vname:"gsb-radiogroup"
}`