Skip to content

Commit 2d3a9a9

Browse files
committed
fix: fixed the bug mentioned in PR xiaoluoboding#78
1 parent 6993a6b commit 2d3a9a9

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

packages/Toast.vue

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@
130130
}
131131
"
132132
>
133-
{{ toast.cancel.label }}
133+
{{ isAction(toast.cancel) ? toast.cancel?.label : toast.cancel }}
134134
</button>
135135
</template>
136136
<template v-if="toast.action">
@@ -148,7 +148,7 @@
148148
}
149149
"
150150
>
151-
{{ toast.action.label }}
151+
{{ isAction(toast.action) ? toast.action?.label : toast.action }}
152152
</button>
153153
</template>
154154
</template>
@@ -172,8 +172,6 @@ const emit = defineEmits<{
172172
// Default lifetime of a toasts (in ms)
173173
const TOAST_LIFETIME = 4000
174174
175-
// Default gap between toasts
176-
177175
const SWIPE_THRESHOLD = 20
178176
179177
const TIME_BEFORE_UNMOUNT = 200
@@ -348,7 +346,7 @@ function onPointerMove(event: PointerEvent) {
348346
}
349347
350348
watchEffect(() => {
351-
offset.value = heightIndex.value * props!.gap! + toastsHeightBefore.value
349+
offset.value = heightIndex.value * props?.gap! + toastsHeightBefore.value
352350
})
353351
354352
watchEffect((onInvalidate) => {
@@ -400,11 +398,11 @@ watchEffect((onInvalidate) => {
400398
})
401399
})
402400
403-
watchEffect(() => {
404-
if (props.toast.delete) {
405-
deleteToast()
406-
}
407-
})
401+
// watchEffect(() => {
402+
// if (props.toast.delete) {
403+
// deleteToast()
404+
// }
405+
// })
408406
409407
onMounted(() => {
410408
if (toastRef.value) {

0 commit comments

Comments
 (0)