mirror of
https://github.com/fofolee/uTools-quickcommand.git
synced 2025-12-18 18:04:28 +08:00
3 个 ui 完善
This commit is contained in:
@@ -7,10 +7,12 @@ import {
|
||||
Dialog,
|
||||
Notify
|
||||
} from 'quasar'
|
||||
import inputBox from "../components/InputBox"
|
||||
import inputBox from "../components/quickcommandUI/InputBox"
|
||||
import buttonBox from "../components/quickcommandUI/ButtonBox"
|
||||
import TextArea from "../components/quickcommandUI/TextArea"
|
||||
|
||||
|
||||
let showInputBox = (options = [], title = "") => {
|
||||
let showInputBox = (options = ["请输入"], title = "") => {
|
||||
return new Promise((reslove, reject) => {
|
||||
let props = {
|
||||
labels: [],
|
||||
@@ -32,6 +34,25 @@ let showInputBox = (options = [], title = "") => {
|
||||
})
|
||||
};
|
||||
|
||||
let showButtonBox = (labels = ["确定"], title = "") => {
|
||||
return new Promise((reslove, reject) => {
|
||||
if (!(labels instanceof Array)) return reject(new TypeError("必须为数组"))
|
||||
let props = {
|
||||
labels: labels,
|
||||
title: title
|
||||
}
|
||||
Dialog.create({
|
||||
component: buttonBox,
|
||||
componentProps: props
|
||||
}).onOk(results => {
|
||||
reslove(results)
|
||||
}).onCancel(() => {
|
||||
console.log('取消')
|
||||
})
|
||||
})
|
||||
};
|
||||
|
||||
|
||||
let showConfirmBox = (message = "", title = "提示") => {
|
||||
return new Promise((reslove, reject) => {
|
||||
Dialog.create({
|
||||
@@ -58,9 +79,28 @@ let showMessageBox = (message, icon = 'success', time = 3000) => {
|
||||
})
|
||||
}
|
||||
|
||||
let showTextArea = (placeholder = "", value = "") => {
|
||||
return new Promise((reslove, reject) => {
|
||||
let props = {
|
||||
placeholder: placeholder,
|
||||
value: value
|
||||
}
|
||||
Dialog.create({
|
||||
component: TextArea,
|
||||
componentProps: props
|
||||
}).onOk(results => {
|
||||
reslove(results)
|
||||
}).onCancel(() => {
|
||||
console.log('取消')
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
export default {
|
||||
showInputBox,
|
||||
showMessageBox,
|
||||
showConfirmBox
|
||||
};
|
||||
showConfirmBox,
|
||||
showButtonBox,
|
||||
showTextArea
|
||||
};
|
||||
Reference in New Issue
Block a user