Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/njleonzhang/el-message-box-custom-button


https://github.com/njleonzhang/el-message-box-custom-button

Last synced: 18 days ago
JSON representation

Awesome Lists containing this project

README

        

build from https://github.com/njleonzhang/element/tree/messageBox_more_button
and copy from lib/message-box.js

use it as web_modules can not work in [webpack4](https://github.com/webpack/webpack/issues/7610), release for internal use

```
this.$msgbox({
title: '提示',
message: '您可以开枪打鬼子或者弹弓打鬼子,请选择!',
buttons: [
{
text: '取消'
},
{
type: 'primary',
text: '开枪',
action: button => {
alert('开枪')
}
},
{
type: 'warning',
text: '挥刀',
loading: false,
action: async button => {
try {
button.loading = true
await new Promise(resolve => {
setTimeout(() => {
resolve()
}, 1000)
})
alert('弹弓')
} finally {
button.loading = false
}
}
}
]
})
```