<template>
  <div >
    <div class="title">
      <span contenteditable="true" @blur="edit('title', $event)">
        {{ data.title }}
      </span>
    </div>
    <div class="subTitle">
      <span contenteditable="true" @blur="edit('subTitle', $event)">
        {{ data.subTitle }}
      </span>
    </div>
    <div class="content">
      <div class="left">
        <div class="contentSubTitle" contenteditable="true" @blur="edit('contentSubTitle', $event)">
          {{ data.contentSubTitle }}
        </div>
        <div class="contentTitle" contenteditable="true" @blur="edit('contentTitle', $event)">
          {{ data.contentTitle }}
        </div>
        <div class="contentInfo" contenteditable="true" @blur="edit('contentInfo', $event)">
          {{ data.contentInfo }}
        </div>
      </div>
      <div class="right">
        <UploadEl :data="{icon:data.image}"/>
      </div>
    </div>
  </div>
</template>

<script>
import UploadEl from "@/components/editEl/uploadEl.vue";

export default {
  name: 'EditEl2',
  props: ['data'],
  components: {
    UploadEl,
  },
  data() {
    return {}
  },
  mounted() {
  },
  methods: {
    edit(key, e) {
      this.data[key] = e.target.innerText
    }
  }
}
</script>

<style lang="less" scoped>
@import "~@/style.less";

.title {
  padding-top: 4.2vw;
  width: 100%;
  text-align: center;
  font-size: 2.5vw;
  letter-spacing: 4px;
  color: #0003;
}

.subTitle {
  padding-top: 0.4vw;
  width: 100%;
  text-align: center;
  font-size: 1.9vw;
  letter-spacing: 2px;
  color: #000;
}

.content {
  display: inline-block;
  width: 62vw;
  height: 20.1vw;
  border: 1px solid #ccc3;
  margin-top: 3.7vw;
  margin-bottom: 5.2vw;
  vertical-align: top;

  .left {
    vertical-align: top;
    display: inline-block;
    width: 50%;
    height: 100%;
    position: relative;
    background-color: #ffffff;

    .contentTitle {
      position: absolute;
      top: 18.6%;
      left: 12.7%;
      letter-spacing: 1px;
      font-size: 1.4vw;
      color: @standard-color;
    }

    .contentSubTitle {
      position: absolute;
      top: 14.6%;
      left: 12.7%;
      letter-spacing: 3.2px;
      font-size: 1.6vw;
      color: #6666;
    }

    .contentInfo {
      text-align: left;
      position: absolute;
      top: 35.6%;
      width: 73%;
      left: 50%;
      transform: translateX(-50%);
      letter-spacing: 2.5px;
      font-size: 0.8vw;
      line-height: 1.6vw;
      color: #666;
    }
  }

  .right {
    display: inline-block;
    width: 50%;
    height: 100%;
  }
}
</style>
