<template>
  <div>
    <hr />
    <div class="panel-row">
        <vpd-icon name="target" />
        <div class="panel-label">表数据</div>
        <div class="panel-value">
            <Input v-model="data" @on-change="dataChange(data)" />
        </div>
    </div>
    <div class="panel-row">
      <vpd-icon name="target" />
      <div class="panel-label">表行数</div>
      <div class="panel-value">
          <Input v-model="activeElement.option.rowNum" />
      </div>
    </div>
    <div class="panel-row">
      <vpd-icon name="target" />
      <div class="panel-label">轮播时间间隔(ms)</div>
      <div class="panel-value">
        <Input v-model="activeElement.option.waitTime" />
      </div>
    </div>
    
    <div class="panel-row">
      <vpd-icon name="target" />
      <div class="panel-label">轮播方式</div>
      <div class="panel-value">
        <Input v-model="activeElement.option.carousel" />
      </div>
    </div>
    <div class="panel-row">
      <vpd-icon name="target" />
      <div class="panel-label">单位</div>
      <div class="panel-value">
        <Input v-model="activeElement.option.unit" />
      </div>
    </div>
    <div class="panel-row">
      <vpd-icon name="target" />
      <div class="panel-label">自动排序</div>
      <div class="panel-value">
        <Input v-model="activeElement.option.sort" />
      </div>
    </div>
  </div>
  
</template>

<script>
export default {
  name: "DataVScrollrankingboardStyle",
  props: ["activeElement"],
  data() {
    return {
      data:JSON.stringify(this.activeElement.option.data),
      
    };
  },
  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.colors,typeof(this.colors),8888)
  }
};
</script>
