<template>
  <dv-digital-flop 
    :config="config1"
    :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-digitalflop";

const config1 = {
  number: [100],
  content: '{nt}个'
}
const config2 = {
  number: [999],
  content: '{nt}个'
}

export default {
  name: WIDGET_NAME,
  props: ["h", "val", "playState", "w"],
  data() {
    return {
      config1: {},
      config2: {}
    };
  }, 
  icon: {
    type: "ios-information-circle"
  },
  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: "#fff",
    backPic: "",
    backPicUrl: "",
    text: "数字翻牌器",
    belong: "page",
    animationName: "",
    config1: config1,
    config2: config2
  },
   watch: {
    val: {
      handler: function (newValue, oldval) {
        this.config1 = newValue.option1
        // console.log( this.config,999999)
        this.config1={...this.config1} //
        this.config2={...this.config2} //
      },
      deep: true// 对象内部的属性监听，也叫深度监听
    }
  },
  mounted(){
    console.log(this.val,6666666)
    this.config1 = this.val.config1
    this.config2 = this.val.config2
  }  
}
</script>

<style scoped>
</style>
