<template>
  <!-- 公告 -->
  <el-dialog v-model="visible" :show-close="false" width="500" :close-on-click-modal="false"
    :close-on-press-escape="false">
    <template #header>
      <div class="my-header">
        <div style="color: white;">{{ title }}</div>
      </div>
    </template>
    <div v-html="content" style="padding: 12px;height: 500px;"></div>
  </el-dialog>
</template>
<script setup>
import { getCurrentInstance, toRefs } from 'vue'

// import emitter from '../../eventBus';
const props = defineProps({
  title: {
    type: 'String',
    default: ''
  },
  content: {
    type: 'String',
    default: ''
  }
});
const { title, content } = toRefs(props)
const visible = ref(false)
const close = () => {
  visible.value = false
}
onMounted(() => {
  // console.log('mounted notification')
  // console.log(emitter)
  // emitter.on('show-dialog', open);
  const instance = getCurrentInstance().appContext.app
  // app.config.globalProperties.$notificate = { openForUpdate }
});

onUnmounted(() => {
  // emitter.off('show-dialog');
});

defineExpose({
  open,
  openForUpdate
})
</script>