<template>
<!-- width: val.width / w * 100 + '%', -->
  <dv-scroll-board 
    :config="config" 
    :style="{
      position: 'absolute',
      width: val.width  + '%',
      height: val.height  + '%',
      left: val.left  + '%',
      top: val.top  + '%',
      zIndex: val.z,
      backgroundColor: val.bgColor
    }"/>
</template>

<script>

import stylec from "./style.vue";
const WIDGET_NAME = "dataV-scrollboard";
const option ={
    header: ['列1', '列2', '列3'],
    data: [
        ['行1列1', '行1列2', '行1列3'],
        ['行2列1', '行2列2', '行2列3'],
        ['行3列1', '行3列2', '行3列3'],
        ['行4列1', '行4列2', '行4列3'],
        ['行5列1', '行5列2', '行5列3'],
        ['行6列1', '行6列2', '行6列3'],
        ['行7列1', '行7列2', '行7列3'],
        ['行8列1', '行8列2', '行8列3'],
        ['行9列1', '行9列2', '行9列3'],
        ['行10列1', '行10列2', '行10列3']
    ],
}
export default {
  name: WIDGET_NAME,
  props: ["h", "val", "playState", "w"],
  data() {
    return {
      config: {}
    };
  }, 
  icon: {
    type: "ios-list-box"
  },
  title: "轮播表",
  panel: stylec,
  setting: {
    type: WIDGET_NAME,
    isContainer: true,
    isUpload: false,
    hasGuide: true,
    isChild: true,
    draggable: true,
    resizable: true,
    name: "轮播表",
    width: 30,
    height: 30,
    left: 10,
    offsetLeft: 10,
    offsetTop: 10,
    offsetWidth: 100,  // 父组件相对于page的百分比
    offsetHeight: 100, // 父组件相对于page的百分比
    z: 0,
    bgColor: '#00265f',
    backPic: "",
    backPicUrl: "",
    text: "轮播表",
    belong: "page",
    animationName: "",
    option: option
  },
  watch: {
    val: {
      handler: function (newValue, oldval) {
        this.config = newValue.option
        // console.log( this.config,999999)
        this.config={...this.config} //
      },
      deep: true// 对象内部的属性监听，也叫深度监听
    }
  },
  mounted(){
    console.log(this.val,6666666)
    this.config = this.val.option
  }  
};
</script>

<style scoped>
</style>
