index.uts 364 字节
Newer Older
DCloud-yyl's avatar
DCloud-yyl 已提交
1
import { ExitOptions, ExitFailCallback, ExitCompleteCallback, Exit} from "../interface.uts"
DCloud-yyl's avatar
DCloud-yyl 已提交
2
import { ExitFailImpl } from "../unierror.uts"
DCloud-yyl's avatar
DCloud-yyl 已提交
3 4 5 6 7 8 9


/**
 * 实现uni.exit
 * iOS平台不支持,触发错误回调
 */
export const exit : Exit = function (options: ExitOptions | null) {
DCloud-yyl's avatar
DCloud-yyl 已提交
10
	let err = new ExitFailImpl(12001);
DCloud-yyl's avatar
DCloud-yyl 已提交
11 12 13
	options?.fail?.(err)
	options?.complete?.(err)
}