Add modal dialog method
This commit is contained in:
parent
341d2ae845
commit
2850eecf7a
1 changed files with 14 additions and 2 deletions
16
src/main.js
16
src/main.js
|
|
@ -36,8 +36,20 @@ Vue.mixin({
|
||||||
return new Promise(showModal)
|
return new Promise(showModal)
|
||||||
},
|
},
|
||||||
|
|
||||||
modalNotify: function(message) {
|
modalNotify: function(message, status = 'success') {
|
||||||
UIkit.notification({message: message, status: 'success'})
|
UIkit.notification({message: message, status: status})
|
||||||
|
},
|
||||||
|
|
||||||
|
modalDialog: function(title, message) {
|
||||||
|
UIkit.modal.dialog(`
|
||||||
|
<button class="uk-modal-close-default" type="button" uk-close></button>
|
||||||
|
<div class="uk-modal-header">
|
||||||
|
<h2 class="uk-modal-title">${title}</h2>
|
||||||
|
</div>
|
||||||
|
<div class="uk-modal-body">
|
||||||
|
<p>${message}</p>
|
||||||
|
</div>
|
||||||
|
`);
|
||||||
},
|
},
|
||||||
|
|
||||||
modalError: function(error) {
|
modalError: function(error) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue