<template>
  <el-dialog
    v-dialogdrag
    :show-close="false"
    v-bind="$attrs"
    v-on="$listeners"
    :width=width
    :close-on-click-modal="false"
  >
    <template slot="title">
      <div class="header">
        <div class="header-title">{{ newTitle || title }}</div>
        <i class="el-icon-close close" @click="dialogClosed"></i>
      </div>
    </template>
    <slot></slot>
    <span slot="footer" v-if="$slots.footer">
      <slot name="footer"></slot>
    </span>
  </el-dialog>
</template>

<script>
export default {
  name: "FireflyDialog",
  inheritAttrs: false,
  props: {
    width:{
      type: String,
      default: "480px",
    },
    newTitle: {
      type: String,
      default: "",
    },
    title: {
      type: String,
      default: "",
    },
  },

  methods: {
    dialogClosed() {
      this.$emit("update:visible", false);
    },
  },
};
</script>

<style lang='scss' scoped>
@import "../../../css/fireflyDialog.scss";
</style>
