mirror of
https://github.com/fofolee/uTools-quickcommand.git
synced 2025-06-08 22:51:25 +08:00
quickcommand.showConfirmBox支持html及设置宽度
This commit is contained in:
parent
ebb1b79b73
commit
f34b80ee42
@ -1,11 +1,12 @@
|
||||
<template>
|
||||
<q-card class="q-dialog-plugin">
|
||||
<q-card class="q-dialog-plugin" :style="{
|
||||
width: options.width ? options.width + 'px' : '450px'
|
||||
}">
|
||||
<q-card-section>
|
||||
<div class="text-h5" align="left" v-text="options.title"></div>
|
||||
</q-card-section>
|
||||
<q-card-section>
|
||||
{{ options.message }}
|
||||
</q-card-section>
|
||||
<q-card-section v-if="options.isHtml" v-html="options.message" class="content" />
|
||||
<q-card-section v-else v-text="options.message" class="content" />
|
||||
<q-card-section class="flex justify-end q-gutter-sm">
|
||||
<q-btn flat label="取消" color="grey" @click="hide" />
|
||||
<q-btn flat autofocus label="确定" color="primary" @click="clickOK()" />
|
||||
@ -29,3 +30,10 @@ export default {
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.content {
|
||||
overflow: auto;
|
||||
max-height: 350px;
|
||||
}
|
||||
</style>
|
||||
|
@ -1,30 +1,13 @@
|
||||
<template>
|
||||
<q-dialog
|
||||
v-model="showDialog"
|
||||
:maximized="maximized"
|
||||
:transition-show="maximized ? 'fade' : 'scale'"
|
||||
:transition-hide="maximized ? 'fade' : 'scale'"
|
||||
>
|
||||
<component
|
||||
ref="ui"
|
||||
:is="currentUI"
|
||||
:options="options"
|
||||
@clickOK="clickOK"
|
||||
@hide="showDialog = false"
|
||||
/>
|
||||
<q-dialog v-model="showDialog" :maximized="maximized" :transition-show="maximized ? 'fade' : 'scale'"
|
||||
:transition-hide="maximized ? 'fade' : 'scale'">
|
||||
<component ref="ui" :is="currentUI" :options="options" @clickOK="clickOK" @hide="showDialog = false" />
|
||||
</q-dialog>
|
||||
<!-- waitButton 单独一个 -->
|
||||
<q-btn
|
||||
class="fixed-top-right"
|
||||
style="z-index: 9999"
|
||||
v-if="showWb"
|
||||
color="primary"
|
||||
:label="wbLabel"
|
||||
@click="
|
||||
<q-btn class="fixed-top-right" style="z-index: 9999" v-if="showWb" color="primary" :label="wbLabel" @click="
|
||||
showWb = false;
|
||||
wbEvent();
|
||||
"
|
||||
/>
|
||||
" />
|
||||
</template>
|
||||
|
||||
<script>
|
||||
@ -79,9 +62,9 @@ export default {
|
||||
this.showUI(ButtonBox, { labels, title }, false, reslove);
|
||||
}),
|
||||
|
||||
showConfirmBox: (message = "", title = "提示") =>
|
||||
showConfirmBox: (message = "", title = "提示", isHtml = false, width) =>
|
||||
new Promise((reslove, reject) => {
|
||||
this.showUI(ConfirmBox, { message, title }, false, reslove);
|
||||
this.showUI(ConfirmBox, { message, title, isHtml, width }, false, reslove);
|
||||
}),
|
||||
|
||||
showMessageBox: (message, icon = "success", time) => {
|
||||
|
Loading…
x
Reference in New Issue
Block a user