no message

This commit is contained in:
kuaifan 2025-08-11 22:35:58 +08:00
parent 09cebb90fe
commit 90a4a01de7
2 changed files with 19 additions and 12 deletions

View File

@ -368,16 +368,29 @@ export default {
* @param config * @param config
*/ */
async onOpen(config) { async onOpen(config) {
//
this.backupConfigs[config.name] = $A.cloneJSON(config);
//
if (!$A.isHave(config.capsule, true)) {
const capsuleCache = await $A.IDBJson("microAppsCapsuleCache");
if ($A.isJson(capsuleCache[config.name])) {
config.capsule = capsuleCache[config.name];
}
}
// blank
if (/_blank$/i.test(config.url_type)) { if (/_blank$/i.test(config.url_type)) {
await this.inlineBlank(config) await this.inlineBlank(config)
return return
} }
//
if (config.url_type === 'external') { if (config.url_type === 'external') {
await this.externalWindow(config) await this.externalWindow(config)
return return
} }
this.backupConfigs[config.name] = $A.cloneJSON(config);
const app = this.microApps.find(({name}) => name == config.name); const app = this.microApps.find(({name}) => name == config.name);
if (app) { if (app) {
// keep_alive // keep_alive
@ -399,12 +412,6 @@ export default {
}) })
} else { } else {
// //
if (!$A.isHave(config.capsule, true)) {
const capsuleCache = await $A.IDBJson("microAppsCapsuleCache");
if ($A.isJson(capsuleCache[config.name])) {
config.capsule = capsuleCache[config.name];
}
}
config.isOpen = false config.isOpen = false
config.postMessage = () => {} config.postMessage = () => {}
config.onBeforeClose = () => true config.onBeforeClose = () => true

View File

@ -9,7 +9,7 @@
<!-- 胶囊工具栏 --> <!-- 胶囊工具栏 -->
<div v-if="capsuleMenuShow" class="micro-modal-cmask"></div> <div v-if="capsuleMenuShow" class="micro-modal-cmask"></div>
<div class="micro-modal-capsule" :style="capsuleStyle"> <div class="micro-modal-capsule" :style="capsuleStyle">
<div class="micro-modal-capsule-item" @click="onCapsuleMore"> <div class="micro-modal-capsule-item" v-touchclick="onCapsuleMore">
<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg"> <svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M2 11C3.10457 11 4 10.1046 4 9C4 7.89543 3.10457 7 2 7C0.895431 7 0 7.89543 0 9C0 10.1046 0.895431 11 2 11Z" fill="currentColor"/> <path d="M2 11C3.10457 11 4 10.1046 4 9C4 7.89543 3.10457 7 2 7C0.895431 7 0 7.89543 0 9C0 10.1046 0.895431 11 2 11Z" fill="currentColor"/>
<path d="M9 12C10.6569 12 12 10.6569 12 9C12 7.34315 10.6569 6 9 6C7.34315 6 6 7.34315 6 9C6 10.6569 7.34315 12 9 12Z" fill="currentColor"/> <path d="M9 12C10.6569 12 12 10.6569 12 9C12 7.34315 10.6569 6 9 6C7.34315 6 6 7.34315 6 9C6 10.6569 7.34315 12 9 12Z" fill="currentColor"/>
@ -17,7 +17,7 @@
</svg> </svg>
</div> </div>
<div class="micro-modal-capsule-line"></div> <div class="micro-modal-capsule-line"></div>
<div class="micro-modal-capsule-item" @click="attemptClose"> <div class="micro-modal-capsule-item" v-touchclick="attemptClose">
<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg"> <svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M9 16C12.866 16 16 12.866 16 9C16 5.13401 12.866 2 9 2C5.13401 2 2 5.13401 2 9C2 12.866 5.13401 16 9 16Z" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/> <path d="M9 16C12.866 16 16 12.866 16 9C16 5.13401 12.866 2 9 2C5.13401 2 2 5.13401 2 9C2 12.866 5.13401 16 9 16Z" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M9 12C10.6569 12 12 10.6569 12 9C12 7.34315 10.6569 6 9 6C7.34315 6 6 7.34315 6 9C6 10.6569 7.34315 12 9 12Z" fill="currentColor"/> <path d="M9 12C10.6569 12 12 10.6569 12 9C12 7.34315 10.6569 6 9 6C7.34315 6 6 7.34315 6 9C6 10.6569 7.34315 12 9 12Z" fill="currentColor"/>
@ -48,13 +48,13 @@
<script> <script>
import TransferDom from "../../directives/transfer-dom"; import TransferDom from "../../directives/transfer-dom";
import touchclick from "../../directives/touchclick";
import ResizeLine from "../ResizeLine.vue"; import ResizeLine from "../ResizeLine.vue";
import { mapState } from "vuex";
export default { export default {
name: 'MicroModal', name: 'MicroModal',
components: {ResizeLine}, components: {ResizeLine},
directives: {TransferDom}, directives: {TransferDom, touchclick},
props: { props: {
open: { open: {
type: Boolean, type: Boolean,