index.vue 1.18 KB
<template>
  <div>
    <div class="initPanel flex" :style="{ width: panelWidth, minHeight: panelMinHeight }">
      <img src="@/assets/Shape.png" alt="" />
      <label>{{ panelContent }}</label>
      <i class="el-icon-close" @click="closeInitPanel"></i>
    </div>
  </div>
</template>

<script>
export default {
  props: {
    panelWidth: {
      type: String,
      default: ''
    },
    panelMinHeight: {
      type: String,
      default: '20px'
    },
    panelContent: {
      type: String,
      default: '请传入面板内容'
    },
    isShowCloseBtn: {
      type: Boolean,
      default: false
    }
  },
  data() {
    return {}
  },
  methods: {
    closeInitPanel() {
      this.$emit('closePanel')
    }
  }
}
</script>

<style lang="scss" scoped>
// @import '@/styles/variables.scss';
.initPanel {
  margin-bottom: 20px;
  position: relative;
  box-sizing: border-box;
  background: #e6e9ff;
  border-radius: 4px;
  padding: 0 8px;
  font-size: 14px;
  font-weight: 400;
  color: rgba(0, 0, 0, 0.65);
  line-height: 20px;
  img {
    margin-right: 4px;
  }
  i {
    width: 9px;
    height: 9px;
    cursor: pointer;
      position: absolute;
    top: 14px;
    right: 18px;
  }
}
</style>