UNPKG

@zhangqingcq/plug-r-qw

Version:

A JS lib base on Vue and View-design, you can achieve some complex functions with simple code after install this lib.

19 lines (17 loc) 536 B
/** * created 2020.07.03 * @author Ricky <zhangqingcq@foxmail.com> */ import $swal from './swal.js' import { t } from '../locale/index' export default function (title, text, icon, onOk, closeOnClickOutside = false) { const T = (...arg) => t.apply(this, arg) $swal.call(this, { title: title === null ? T('r.info.title') : title, text: text === null ? T('r.info.text') : text, icon: icon === null ? 'warning' : icon, onOk: onOk, buttons: [T('r.cancel')], closeOnClickOutside: closeOnClickOutside }) }