Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/njleonzhang/el-message-box-custom-button
- Owner: njleonzhang
- Created: 2018-06-27T09:16:58.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-06-27T09:25:22.000Z (over 6 years ago)
- Last Synced: 2024-11-06T13:48:01.279Z (2 months ago)
- Language: JavaScript
- Size: 7.81 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
build from https://github.com/njleonzhang/element/tree/messageBox_more_button
and copy from lib/message-box.jsuse 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
}
}
}
]
})
```