解决 frame 内变量问题

This commit is contained in:
fofolee
2022-04-23 00:09:33 +08:00
parent 0f9f003c0a
commit f99123518a
3 changed files with 34 additions and 40 deletions

View File

@@ -21,8 +21,8 @@ const quickcommand = {
hints: [],
title: title
}
if (!(options instanceof Object)) return reject(new TypeError(`应为 Object, 而非 ${typeof options}`))
if (options instanceof Array) props.labels = options
if (!_.isObject(options)) return reject(new TypeError(`应为 Object, 而非 ${typeof options}`))
if (_.isArray(options)) props.labels = options
else Object.assign(props, options)
Dialog.create({
component: inputBox,
@@ -35,7 +35,7 @@ const quickcommand = {
}),
showButtonBox: (labels = ["确定"], title = "") => new Promise((reslove, reject) => {
if (!(labels instanceof Array)) return reject(new TypeError(`应为 Array, 而非 ${typeof labels}`))
if (!_.isArray(labels)) return reject(new TypeError(`应为 Array, 而非 ${typeof labels}`))
let props = {
labels: labels,
title: title
@@ -91,7 +91,7 @@ const quickcommand = {
}),
showSelectList: (selects, options = {}) => new Promise((reslove, reject) => {
if (!(selects instanceof Array)) return reject(new TypeError(`应为 Array, 而非 ${typeof selects}`))
if (!_.isArray(selects)) return reject(new TypeError(`应为 Array, 而非 ${typeof selects}`))
let defaultOptions = {
placeholder: "输入进行筛选,支持拼音",
optionType: "plaintext",
@@ -128,4 +128,4 @@ const quickcommand = {
}
}
export default quickcommand
export default quickcommand