mirror of
https://github.com/jxxghp/MoviePilot-Frontend.git
synced 2026-05-25 18:29:44 +08:00
add toast-notification
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
import api from "@/api";
|
||||
import { doneNProgress, startNProgress } from "@/api/nprogress";
|
||||
import { MediaInfo, Subscribe } from "@/api/types";
|
||||
import { useToast } from "vue-toast-notification";
|
||||
|
||||
// 输入参数
|
||||
const props = defineProps({
|
||||
@@ -10,6 +11,9 @@ const props = defineProps({
|
||||
height: String,
|
||||
});
|
||||
|
||||
// 提示框
|
||||
const $toast = useToast();
|
||||
|
||||
// 图片加载状态
|
||||
const isImageLoaded = ref(false);
|
||||
|
||||
@@ -44,7 +48,7 @@ const addSubscribe = async () => {
|
||||
// 订阅成功
|
||||
isSubscribed.value = true;
|
||||
} else {
|
||||
// TODO 弹出错误提示
|
||||
$toast.error(`${props.media?.title} 添加订阅失败:${result.message}!`);
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
|
||||
Reference in New Issue
Block a user