|
@@ -10,39 +10,63 @@
|
|
|
<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: ''
|
|
|
+<script>
|
|
|
+import { getCurrentInstance, toRefs, onMounted } from 'vue'
|
|
|
+import { ElDialog } from 'element-plus';
|
|
|
+import 'element-plus/theme-chalk/el-dialog.css'; // 引入 el-dialog 的样式
|
|
|
+import 'element-plus/theme-chalk/el-button.css';
|
|
|
+// import { ElDialog } from 'element-plus';
|
|
|
+export default {
|
|
|
+ name: 'Notification',
|
|
|
+ props: {
|
|
|
+ title: {
|
|
|
+ type: String,
|
|
|
+ default: ''
|
|
|
+ },
|
|
|
+ content: {
|
|
|
+ type: String,
|
|
|
+ default: ''
|
|
|
+ }
|
|
|
},
|
|
|
- content: {
|
|
|
- type: 'String',
|
|
|
- default: ''
|
|
|
+ setup() {
|
|
|
+ const visible = ref(false)
|
|
|
+ onMounted(() => {
|
|
|
+ visible.value = true
|
|
|
+ })
|
|
|
+ return { visible }
|
|
|
}
|
|
|
-});
|
|
|
-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');
|
|
|
-});
|
|
|
+// // 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
|
|
|
+// // instance.config.globalProperties.$notificate = { openForUpdate }
|
|
|
+// });
|
|
|
+
|
|
|
+// onUnmounted(() => {
|
|
|
+// // emitter.off('show-dialog');
|
|
|
+// });
|
|
|
|
|
|
-defineExpose({
|
|
|
- open,
|
|
|
- openForUpdate
|
|
|
-})
|
|
|
+// defineExpose({
|
|
|
+// open,
|
|
|
+// openForUpdate
|
|
|
+// })
|
|
|
</script>
|