<template>
  <div>
    <hr />
    
    <div class="panel-row">
      <vpd-icon name="target" />
      <div class="panel-label">进度池数值</div>
      <div class="panel-value" >
          <Input v-model="value" @on-change="valueChange(value)"/>
      </div>
    </div>
    <div class="panel-row">
      <vpd-icon name="target" />
      <div class="panel-label">进度池配色</div>
      <div class="panel-value">
          <Input v-model="colors" />
      </div>
    </div>
    <div class="panel-row">
      <vpd-icon name="target" />
      <div class="panel-label">边框宽度</div>
      <div class="panel-value">
        <Input v-model="activeElement.option.borderWidth" />
      </div>
    </div>
    
    
    <div class="panel-row">
      <vpd-icon name="target" />
      <div class="panel-label">边框间隙</div>
      <div class="panel-value">
        <Input v-model="activeElement.option.borderGap" />
      </div>
    </div>
    <div class="panel-row">
      <vpd-icon name="target" />
      <div class="panel-label">局部渐变</div>
      <div class="panel-value">
        <Input v-model="activeElement.option.localGradient" />
      </div>
    </div>
    <div class="panel-row">
      <vpd-icon name="target" />
      <div class="panel-label">信息格式化</div>
      <div class="panel-value">
        <Input v-model="activeElement.option.formatter" />
      </div>
    </div>
    
    
  </div>
  
</template>

<script>
export default {
  name: "DataVPercentpondStyle",
  props: ["activeElement"],
  data() {
    return {
      value:JSON.stringify(this.activeElement.option.value),
      colors:JSON.stringify(this.activeElement.option.colors)
    };
  },
  methods: {
    valueChange(newCode) {
      this.activeElement.option.value = JSON.parse(newCode);
      this.$parent.$vpd.commit("updateWidgets", this.activeElement);
    }
  },
  created () {
      // console.log(this.data,typeof(this.data),8888)
      // console.log(this.colors,typeof(this.colors),8888)
  }
};
</script>
