<template>
  <div class="templateEditBtnBox" @click="openEditWindow">
    <i class="el-icon-setting"></i>
  </div>
</template>

<script>
export default {
  props: {
    id: {
      type:Number,
      default:0
    },
    sort:{
      type:Number,
      default:0
    },
    type:{//组件类型 1=新闻(单个) 2=新闻(多个) 3=广告 4=友情链接 5=底部导航 6=静态html组件 7=文字 8=评论
      type:Number,
      default:0
    },
    size:{
      type:Number,
      default:0
    }
  },
  data() {
    return {
      
    };
  },
  methods: {
    openEditWindow(){
      let data = {
        id:this.id,
        sort:this.sort,
        type:this.type,
        size:this.size
      }
      console.log(data);
      this.$store.commit('template/setEditWindowStatus',data);
    }
  },
  mounted() {
    
  },
};
</script>

<style scoped lang="less">
  .templateEditBtnBox {
    position: absolute;
    top: 0;
    left: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin: 5px;
    color: #000;
    background: #fff;
    border: 1px solid #000;
    border-radius: 5px;
    width: 24px;
    height: 24px;
    line-height: 24px;
    text-align: center;
    font-size: 14px;
    transition: all 0.3s;
    z-index: 999;
    &:hover {
      color: #fff;
      background: #000;
    }
  }
</style>
