<template>
  <component
    :is="val.decorationType"
    :class="[playState ? 'anm-' + val.animationName : '']"
    :ghost="val.ghost"
    :size="val.size"
    :long="val.long"
    :disabled="val.disabled"
    :loading="val.loading"
    :icon="val.icon"
    :custom-icon="val.customIcon"
    :target="val.target"
    :html-type="val.htmlType"
    :style="{
      position: 'absolute',
      width: val.width  + '%',
      height: val.height  + '%',
      left: val.left  + '%',
      top: val.top  + '%',
      zIndex: val.z,
      backgroundColor: val.bgColor
    }"
  >dv-border-box-8</component>
</template>

<script>
const WIDGET_NAME = "dataV-decoration";
import stylec from "./style.vue";

export default {
  name: WIDGET_NAME,
  icon: {
    type: "ios-flower"
  },
  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: "",
    decorationType: "dvDecoration-1"
  },
  props: ["h", "val", "playState", "w"]
};
</script>

<style scoped>
</style>
