<template>
  <div class="templateEditBtnBox" @click="openComponentListWindow" v-if="this.$store.state.template.previewStatus==false">
    <i class="el-icon-scissors"></i>
  </div>
</template>

<script>
export default {
  props: {
    id: {
      type:Number,
      default:0
    },
    sort:{
      type:Number,
      default:0
    },
    type:{
      type:Number,
      default:0
    }
  },
  data() {
    return {
      
    };
  },
  methods: {
    openComponentListWindow(){
      let style = this.$store.state.template.pageData.index[this.id].content.componentList[this.sort].component_style;
      let data = {
        id:this.id,
        sort:this.sort,
        type:this.type,
        style:style
      }
      console.log(data);
      this.$store.commit('template/setComponentStyleStatus',data);
    }
  },
  mounted() {
    
  },
};
</script>

<style scoped lang="less">
  .templateEditBtnBox {
    position: absolute;
    top: 0;
    left: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin: 5px;
    color: #666;
    background: rgba(255,255,255,0.5);
    border-radius: 5px;
    width: 30px;
    height: 30px;
    line-height: 30px;
    text-align: center;
    font-size: 30px;
    transition: all 0.3s;
    z-index: 999;
    &:hover {
      color: #333;
    }
  }
</style>
