Skip to content

Commit 7300e49

Browse files
fix: show toast
fix #791
1 parent 4b919e9 commit 7300e49

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

website/src/components/utils/Toast.vue

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
11
<script lang="ts">
2-
let instance: any
32
export function showToast(txt: string) {
4-
if (instance) {
5-
instance.show(txt)
3+
let show = (window as any).instanceShow
4+
if (show) {
5+
show(txt)
66
}
77
}
88
</script>
99
<script setup lang="ts">
10-
import { ref, watch, getCurrentInstance } from 'vue'
10+
import { ref, watch } from 'vue'
1111
let shown = ref(false)
1212
let text = ref('')
13-
instance = getCurrentInstance()
14-
instance.show = function show(val: string) {
13+
;(window as any).instanceShow = function show(val: string) {
1514
text.value = val
1615
}
1716
let timer: number

0 commit comments

Comments
 (0)