CNCEC_APP/uni_modules/uview-pro/libs/function/toast.ts

15 lines
555 B
TypeScript
Raw Permalink Normal View History

2026-03-25 14:54:15 +08:00
/**
* Toast
* @param title
* @param option 1500 /none
*/
function toast(title: string, option: number | string | Record<string, any> = 1500): void {
uni.showToast({
title: title,
icon: typeof option === 'string' ? option : typeof option === 'object' ? option.icon || 'none' : 'none',
duration: typeof option === 'number' ? option : typeof option === 'object' ? option.duration || '1500' : 1500
});
}
export default toast;