<template>
  <div>
    <hr />
    <div class="panel-row">
      <vpd-icon name="target" />
      <div class="panel-label">环半径</div>
      <!-- <div class="panel-value">{{ activeElement.buttonType }}</div> -->
      <div class="panel-value">
        <Input v-model="activeElement.radius" />
      </div>
    </div>
    
    <div class="panel-row">
      <vpd-icon name="target" />
      <div class="panel-label">动态环半径</div>
      <div class="panel-value">
          <Input v-model="activeElement.activeRadius" />
      </div>
    </div>
     <div class="panel-row">
      <vpd-icon name="target" />
      <div class="panel-label">数据</div>
      <!-- style="margin-left:23%" -->
      <div class="panel-value" >
          <Input v-model="data" @on-change="dataChange(data)"/>
        <!-- <codemirror :value="dataf" :options="cmOptions" @input="dataChange"></codemirror> -->
      </div>
    </div>
     <div class="panel-row">
      <vpd-icon name="target" />
      <div class="panel-label">环线条宽度</div>
      <div class="panel-value">
          <Input v-model="activeElement.lineWidth" />
      </div>
    </div>
    <div class="panel-row">
      <vpd-icon name="target" />
      <div class="panel-label">环颜色</div>
      <div class="panel-value">
          <Input v-model="color" />
      </div>
    </div>
    <div class="panel-row">
      <vpd-icon name="target" />
      <div class="panel-label">切换间隔(ms)</div>
      <div class="panel-value">
        <Input v-model="activeElement.activeTimeGap" />
      </div>
    </div>
    <!-- <div class="panel-row">
      <vpd-icon name="target" />
      <div class="panel-label">数字翻牌器样式</div>
      <div class="panel-value">
        <Input v-model="activeElement.digitalFlopStyle" />
      </div>
    </div> -->
    <div class="panel-row">
      <vpd-icon name="target" />
      <div class="panel-label">数字翻牌器小数位数</div>
      <div class="panel-value">
          <Input v-model="activeElement.digitalFlopToFixed" />
      </div>
    </div>
    <div class="panel-row">
      <vpd-icon name="target" />
      <div class="panel-label">动效曲线</div>
      <div class="panel-value">
          <Input v-model="activeElement.animationCurve" />
      </div>
    </div>
    <div class="panel-row">
      <vpd-icon name="target" />
      <div class="panel-label">动效帧数</div>
      <div class="panel-value">
         <Input v-model="activeElement.animationFrame" />
      </div>
    </div>
    <div class="panel-row">
      <vpd-icon name="target" />
      <div class="panel-label">显示原始值</div>
      <div class="panel-value">
         <Input v-model="activeElement.showOriginValue" />
      </div>
    </div>
    
  </div>
  
</template>

<script>
export default {
  name: "DataVDynamicirStyle",
  props: ["activeElement"],
  data() {
    return {
    //     cmOptions: {
    //     // codemirror options
    //     tabSize: 4,
    //     mode: {
    //       name: "javascript",
    //       json: true
    //     },
    //     theme: "base16-dark",
    //     lineNumbers: true,
    //     line: true
    //     // more codemirror options, 更多 codemirror 的高级配置...
    //   },
      data:JSON.stringify(this.activeElement.option.data),
      color:JSON.stringify(this.activeElement.color)
    };
  },
  methods: {
    dataChange(newCode) {
      this.activeElement.option.data = JSON.parse(newCode);
      this.$parent.$vpd.commit("updateWidgets", this.activeElement);
    }
  },
  created () {
      console.log(this.data,typeof(this.data),8888)
      // console.log(this.color,typeof(this.color),8888)
  }
};
</script>
