[add] EventBus使用

This commit is contained in:
2022-08-01 14:23:29 +08:00
parent 17b9af484e
commit cf95786b9c
34 changed files with 34622 additions and 635 deletions

View File

@@ -1,11 +1,22 @@
<script setup lang="ts">
import { ElDialog } from 'element-plus';
import { ref } from 'vue';
import 'vue-loading-overlay/dist/vue-loading.css';
import GameCanvas from './components/GameCanvas.vue';
import Popup from './components/Popup.vue';
const visible = ref(false)
window["eventBus"].on('alert', (msg: string) => {
visible.value = true;
})
</script>
<template>
<GameCanvas />
<el-dialog v-model="visible" :show-close="false">
<Popup />
</el-dialog>
</template>
<style>

11
src/components/Popup.vue Normal file
View File

@@ -0,0 +1,11 @@
<script setup lang="ts">
import { ref } from 'vue';
import 'vue-loading-overlay/dist/vue-loading.css';
const input = ref('')
</script>
<template>
<el-input v-model="input" placeholder="Please input A" />
<el-input v-model="input" placeholder="Please input B" />
</template>