mirror of
https://github.com/fofolee/uTools-quickcommand.git
synced 2025-08-09 22:29:33 +08:00
增加quickcommand.showMessageBox
This commit is contained in:
parent
4fed36c0ba
commit
1a1d7f160b
@ -105,7 +105,7 @@ module.exports = configure(function (ctx) {
|
||||
// directives: [],
|
||||
|
||||
// Quasar plugins
|
||||
plugins: ['Dialog']
|
||||
plugins: ['Dialog', 'Notify']
|
||||
},
|
||||
|
||||
// animations: 'all', // --- includes all animations
|
||||
|
@ -4,10 +4,13 @@
|
||||
*/
|
||||
|
||||
import {
|
||||
Dialog
|
||||
Dialog,
|
||||
Notify
|
||||
} from 'quasar'
|
||||
import inputBox from "../components/InputBox"
|
||||
|
||||
console.log(Notify);
|
||||
|
||||
let showInputBox = (options = [], title = "") => {
|
||||
return new Promise((reslove, reject) => {
|
||||
let props = {}
|
||||
@ -30,6 +33,18 @@ let showInputBox = (options = [], title = "") => {
|
||||
})
|
||||
})
|
||||
};
|
||||
|
||||
let showMessageBox = (message, icon = 'success', time = 3000) => {
|
||||
if (icon === 'success') icon = 'positive'
|
||||
if (icon === 'error') icon = 'negative'
|
||||
Notify.create({
|
||||
type: icon,
|
||||
message: message,
|
||||
timeout: time,
|
||||
position: 'top',
|
||||
})
|
||||
}
|
||||
export default {
|
||||
showInputBox,
|
||||
showMessageBox
|
||||
};
|
||||
|
@ -123,7 +123,7 @@ interface quickcommandApi {
|
||||
* @param icon 图标,默认为 success
|
||||
* @param time 多少毫秒后消失,默认为 3000
|
||||
*/
|
||||
showMessageBox(message: string, icon?: 'success' | 'error' | 'warning' | 'info' | 'question', time?: number): void;
|
||||
showMessageBox(message: string, icon?: 'success' | 'error' | 'warning' | 'info' , time?: number): void;
|
||||
|
||||
/**
|
||||
* 显示一个确认框,返回是否点击了确认
|
||||
|
Loading…
x
Reference in New Issue
Block a user