We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
在上一篇 promise化的confirm 应该总是 resolved 提到 confirm 的设计
那么对于已有的 resolve/reject 的设计,该怎么让函数永远返回 resolved 的 promise
花了点时间写了个库 p-resolvify
比如 Element-ui 的 confirm 我们就可以
Vue.prototype.$confirm = resolvify(Vue.prototype.$confirm)
或者
ELEMENT.MessageBox.confirm = resolvify(ELEMENT.MessageBox.confirm)
就可以
let result = await this.$confirm('确定?')
而不需要
let result try { result = await this.$confirm('确定?') } catch(err) { result = 'cancel' }
https://jsfiddle.net/fisker/86qmcb72/8/
The text was updated successfully, but these errors were encountered:
No branches or pull requests
在上一篇 promise化的confirm 应该总是 resolved 提到 confirm 的设计
那么对于已有的 resolve/reject 的设计,该怎么让函数永远返回 resolved 的 promise
花了点时间写了个库 p-resolvify
比如 Element-ui 的 confirm 我们就可以
或者
就可以
而不需要
https://jsfiddle.net/fisker/86qmcb72/8/
The text was updated successfully, but these errors were encountered: