UNPKG

@szmg-fe/tarco

Version:

function library in Taro

27 lines (23 loc) 555 B
/* * @Description: showModal * @Date: 2021-04-01 10:14:30 * @Author: Lemon * @LastEditTime: 2021-04-21 14:20:40 */ import Task from 'data.task'; import Taro from './Taro'; const showModal = (content: string) => () => new Task((rej, resolve) => { Taro.showModal({ title: '提示', content, success: function (res) { if (res.confirm) { resolve(res); } else if (res.cancel) { rej(res); } }, fail: rej }); }) export default showModal;