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
@ -26,8 +26,8 @@ module.exports = configure(function (ctx) {
|
|||||||
// --> boot files are part of "main.js"
|
// --> boot files are part of "main.js"
|
||||||
// https://v2.quasar.dev/quasar-cli-webpack/boot-files
|
// https://v2.quasar.dev/quasar-cli-webpack/boot-files
|
||||||
boot: [
|
boot: [
|
||||||
|
|
||||||
|
|
||||||
],
|
],
|
||||||
|
|
||||||
// https://v2.quasar.dev/quasar-cli-webpack/quasar-config-js#Property%3A-css
|
// https://v2.quasar.dev/quasar-cli-webpack/quasar-config-js#Property%3A-css
|
||||||
@ -72,7 +72,7 @@ module.exports = configure(function (ctx) {
|
|||||||
|
|
||||||
// https://v2.quasar.dev/quasar-cli-webpack/handling-webpack
|
// https://v2.quasar.dev/quasar-cli-webpack/handling-webpack
|
||||||
// "chain" is a webpack-chain object https://github.com/neutrinojs/webpack-chain
|
// "chain" is a webpack-chain object https://github.com/neutrinojs/webpack-chain
|
||||||
|
|
||||||
chainWebpack (chain) {
|
chainWebpack (chain) {
|
||||||
chain.plugin('eslint-webpack-plugin')
|
chain.plugin('eslint-webpack-plugin')
|
||||||
.use(ESLintPlugin, [{ extensions: [ 'js', 'vue' ] }])
|
.use(ESLintPlugin, [{ extensions: [ 'js', 'vue' ] }])
|
||||||
@ -105,7 +105,7 @@ module.exports = configure(function (ctx) {
|
|||||||
// directives: [],
|
// directives: [],
|
||||||
|
|
||||||
// Quasar plugins
|
// Quasar plugins
|
||||||
plugins: ['Dialog']
|
plugins: ['Dialog', 'Notify']
|
||||||
},
|
},
|
||||||
|
|
||||||
// animations: 'all', // --- includes all animations
|
// animations: 'all', // --- includes all animations
|
||||||
@ -125,12 +125,12 @@ module.exports = configure(function (ctx) {
|
|||||||
maxAge: 1000 * 60 * 60 * 24 * 30,
|
maxAge: 1000 * 60 * 60 * 24 * 30,
|
||||||
// Tell browser when a file from the server should expire from cache (in ms)
|
// Tell browser when a file from the server should expire from cache (in ms)
|
||||||
|
|
||||||
|
|
||||||
chainWebpackWebserver (chain) {
|
chainWebpackWebserver (chain) {
|
||||||
chain.plugin('eslint-webpack-plugin')
|
chain.plugin('eslint-webpack-plugin')
|
||||||
.use(ESLintPlugin, [{ extensions: [ 'js' ] }])
|
.use(ESLintPlugin, [{ extensions: [ 'js' ] }])
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
middlewares: [
|
middlewares: [
|
||||||
ctx.prod ? 'compression' : '',
|
ctx.prod ? 'compression' : '',
|
||||||
@ -145,12 +145,12 @@ module.exports = configure(function (ctx) {
|
|||||||
|
|
||||||
// for the custom service worker ONLY (/src-pwa/custom-service-worker.[js|ts])
|
// for the custom service worker ONLY (/src-pwa/custom-service-worker.[js|ts])
|
||||||
// if using workbox in InjectManifest mode
|
// if using workbox in InjectManifest mode
|
||||||
|
|
||||||
chainWebpackCustomSW (chain) {
|
chainWebpackCustomSW (chain) {
|
||||||
chain.plugin('eslint-webpack-plugin')
|
chain.plugin('eslint-webpack-plugin')
|
||||||
.use(ESLintPlugin, [{ extensions: [ 'js' ] }])
|
.use(ESLintPlugin, [{ extensions: [ 'js' ] }])
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
manifest: {
|
manifest: {
|
||||||
name: `quickcommand`,
|
name: `quickcommand`,
|
||||||
@ -224,19 +224,19 @@ module.exports = configure(function (ctx) {
|
|||||||
},
|
},
|
||||||
|
|
||||||
// "chain" is a webpack-chain object https://github.com/neutrinojs/webpack-chain
|
// "chain" is a webpack-chain object https://github.com/neutrinojs/webpack-chain
|
||||||
|
|
||||||
chainWebpackMain (chain) {
|
chainWebpackMain (chain) {
|
||||||
chain.plugin('eslint-webpack-plugin')
|
chain.plugin('eslint-webpack-plugin')
|
||||||
.use(ESLintPlugin, [{ extensions: [ 'js' ] }])
|
.use(ESLintPlugin, [{ extensions: [ 'js' ] }])
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
chainWebpackPreload (chain) {
|
chainWebpackPreload (chain) {
|
||||||
chain.plugin('eslint-webpack-plugin')
|
chain.plugin('eslint-webpack-plugin')
|
||||||
.use(ESLintPlugin, [{ extensions: [ 'js' ] }])
|
.use(ESLintPlugin, [{ extensions: [ 'js' ] }])
|
||||||
},
|
},
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -4,10 +4,13 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import {
|
import {
|
||||||
Dialog
|
Dialog,
|
||||||
|
Notify
|
||||||
} from 'quasar'
|
} from 'quasar'
|
||||||
import inputBox from "../components/InputBox"
|
import inputBox from "../components/InputBox"
|
||||||
|
|
||||||
|
console.log(Notify);
|
||||||
|
|
||||||
let showInputBox = (options = [], title = "") => {
|
let showInputBox = (options = [], title = "") => {
|
||||||
return new Promise((reslove, reject) => {
|
return new Promise((reslove, reject) => {
|
||||||
let props = {}
|
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 {
|
export default {
|
||||||
showInputBox,
|
showInputBox,
|
||||||
|
showMessageBox
|
||||||
};
|
};
|
||||||
|
@ -123,7 +123,7 @@ interface quickcommandApi {
|
|||||||
* @param icon 图标,默认为 success
|
* @param icon 图标,默认为 success
|
||||||
* @param time 多少毫秒后消失,默认为 3000
|
* @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