<template>
<TsButton @click="showToastFnDouble">堆叠效果(多条提示)</TsButton>
<TsButton @click="showToastFnWithIcon">带图标提示</TsButton>
<TsButton @click="showToastFnWithDelay">自定义延时提示(3秒)</TsButton>
</template>
<script setup lang="ts">
import TsToast from '../../packages/components/TsToast';
const showToastFnDouble = () => {
TsToast({
message: '堆叠排序的toast',
offset: [0, 50],
useSingleton: false,
});
};
const showToastFnWithIcon = () => {
TsToast({
message: '带图标的提示',
offset: [0, 50],
icon: true,
type: 'success',
});
};
const showToastFnWithDelay = () => {
TsToast({
message: '5秒后自动关闭',
offset: [0, 50],
duration: 5000,
type: 'info',
});
};
</script>