mirror of
https://github.com/BTMuli/TeyvatGuide.git
synced 2025-12-12 09:18:14 +08:00
🎨 优化,dialog → snackbar
This commit is contained in:
@@ -43,14 +43,15 @@
|
|||||||
</v-card>
|
</v-card>
|
||||||
</div>
|
</div>
|
||||||
</v-list-item>
|
</v-list-item>
|
||||||
|
<v-snackbar v-model="showBar" :color="barColor" timeout="1000">
|
||||||
|
{{ barText }}
|
||||||
|
</v-snackbar>
|
||||||
</v-list>
|
</v-list>
|
||||||
</template>
|
</template>
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
// vue
|
// vue
|
||||||
import { ref, onMounted, onUnmounted } from "vue";
|
import { ref, onMounted, onUnmounted } from "vue";
|
||||||
import { useRouter } from "vue-router";
|
import { useRouter } from "vue-router";
|
||||||
// tauri
|
|
||||||
import { dialog } from "@tauri-apps/api";
|
|
||||||
// store
|
// store
|
||||||
import { useHomeStore } from "../store/modules/home";
|
import { useHomeStore } from "../store/modules/home";
|
||||||
// utils
|
// utils
|
||||||
@@ -68,6 +69,10 @@ const homeStore = useHomeStore();
|
|||||||
|
|
||||||
// loading
|
// loading
|
||||||
const loading = ref(true as boolean);
|
const loading = ref(true as boolean);
|
||||||
|
// snackbar
|
||||||
|
const showBar = ref(false as boolean);
|
||||||
|
const barText = ref("");
|
||||||
|
const barColor = ref("error" as string);
|
||||||
|
|
||||||
// data
|
// data
|
||||||
const poolCards = ref([] as GachaCard[]);
|
const poolCards = ref([] as GachaCard[]);
|
||||||
@@ -171,10 +176,9 @@ function checkCover (data: GachaData[]) {
|
|||||||
|
|
||||||
async function toOuter (url: string, title: string) {
|
async function toOuter (url: string, title: string) {
|
||||||
if (!url) {
|
if (!url) {
|
||||||
await dialog.message("该角色池暂无详情", {
|
barText.value = "链接为空!";
|
||||||
title,
|
barColor.value = "error";
|
||||||
type: "error",
|
showBar.value = true;
|
||||||
});
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
createTGWindow(url, "祈愿", title, 1200, 800, true, true);
|
createTGWindow(url, "祈愿", title, 1200, 800, true, true);
|
||||||
|
|||||||
Reference in New Issue
Block a user