feat: 添加全局alert,并替换原先是toast
This commit is contained in:
14
src/App.vue
14
src/App.vue
@@ -1,6 +1,7 @@
|
||||
<script setup lang="ts">
|
||||
import Navbar from "./components/Navbar.vue";
|
||||
import Dialog from "./components/Dialog.vue";
|
||||
import { Alert, useAlertProvider } from "./components/Alert";
|
||||
import { ref, provide, computed, onMounted } from "vue";
|
||||
import { useRouter } from "vue-router";
|
||||
|
||||
@@ -49,19 +50,26 @@ provide("theme", {
|
||||
const currentRoutePath = computed(() => {
|
||||
return router.currentRoute.value.path;
|
||||
});
|
||||
|
||||
useAlertProvider();
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<header class="relative">
|
||||
<Navbar></Navbar>
|
||||
<Dialog></Dialog>
|
||||
<Navbar />
|
||||
<Dialog />
|
||||
<Alert />
|
||||
</header>
|
||||
|
||||
<main>
|
||||
<RouterView />
|
||||
</main>
|
||||
<footer v-if="currentRoutePath != '/project'" class="footer footer-center p-4 bg-base-300 text-base-content">
|
||||
|
||||
<footer
|
||||
v-if="currentRoutePath != '/project'"
|
||||
class="footer footer-center p-4 bg-base-300 text-base-content"
|
||||
>
|
||||
<div>
|
||||
<p>Copyright © 2023 - All right reserved by OurEDA</p>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user