<template>
  <el-dialog
    title="导入提示"
    :visible.sync="dialogVisible"
    width="30%"
    :close-on-click-modal="false"
    append-to-body
  >
    <div v-html="content"></div>

    <div slot="footer" class="dialog-footer">
      <el-button @click="dialogVisible = false">取消</el-button>
      <el-button type="primary" @click="confirm('cover')">覆盖更新</el-button>
      <el-button type="primary" @click="confirm('notCover')"
        >不覆盖更新</el-button
      >
    </div>
  </el-dialog>
</template>

<script>
export default {
  name: 'AppImportCheckDialog',
  data() {
    return {
      dialogVisible: false,
      content: '',
      fail: null,
    }
  },
  methods: {
    open(content, fail) {
      this.dialogVisible = true
      this.content = content
      this.fail = fail
    },
    confirm(type) {
      this.dialogVisible = false
      this.$emit('confirm', type, this.fail)
    },
  },
}
</script>

<style scoped></style>
