no message

This commit is contained in:
kuaifan 2025-05-17 13:53:07 +08:00
parent 8904039515
commit a130c049bf
4 changed files with 49 additions and 41 deletions

View File

@ -479,7 +479,7 @@ class Apps
]; ];
// 处理可选的UI配置 // 处理可选的UI配置
$optionalConfigs = ['transparent', 'keepAlive']; $optionalConfigs = ['transparent', 'autoDarkTheme', 'keepAlive', 'disableScopecss'];
foreach ($optionalConfigs as $config) { foreach ($optionalConfigs as $config) {
if (isset($menu[$config])) { if (isset($menu[$config])) {
$normalizedMenu[$config] = $menu[$config]; $normalizedMenu[$config] = $menu[$config];

View File

@ -7,7 +7,7 @@
:ref="`ref-${app.name}`" :ref="`ref-${app.name}`"
:size="1200" :size="1200"
:transparent="app.transparent" :transparent="app.transparent"
:inheritDarkMode="app.inheritDarkMode" :autoDarkTheme="app.autoDarkTheme"
:beforeClose="async () => { await onBeforeClose(app.name) }"> :beforeClose="async () => { await onBeforeClose(app.name) }">
<micro-app <micro-app
v-if="app.isOpen" v-if="app.isOpen"
@ -331,9 +331,9 @@ export default {
* - url 应用地址 * - url 应用地址
* - props 传递参数 * - props 传递参数
* - transparent 是否透明模式 (true/false)默认 false * - transparent 是否透明模式 (true/false)默认 false
* - autoDarkTheme 是否自动适配深色主题 (true/false)默认 true
* - keepAlive 是否开启微应用保活 (true/false)默认 true * - keepAlive 是否开启微应用保活 (true/false)默认 true
* - disableScopecss 是否禁用样式隔离 (true/false)默认 false * - disableScopecss 是否禁用样式隔离 (true/false)默认 false
* - inheritDarkMode 是否继承暗黑模式 (true/false)默认 false
*/ */
observeMicroApp(config) { observeMicroApp(config) {
// //
@ -341,9 +341,9 @@ export default {
config.url = config.url || null config.url = config.url || null
config.props = $A.isJson(config.props) ? config.props : {} config.props = $A.isJson(config.props) ? config.props : {}
config.transparent = typeof config.transparent == 'boolean' ? config.transparent : false config.transparent = typeof config.transparent == 'boolean' ? config.transparent : false
config.autoDarkTheme = typeof config.autoDarkTheme == 'boolean' ? config.autoDarkTheme : true
config.keepAlive = typeof config.keepAlive == 'boolean' ? config.keepAlive : true config.keepAlive = typeof config.keepAlive == 'boolean' ? config.keepAlive : true
config.disableScopecss = typeof config.disableScopecss == 'boolean' ? config.disableScopecss : false config.disableScopecss = typeof config.disableScopecss == 'boolean' ? config.disableScopecss : false
config.inheritDarkMode = typeof config.inheritDarkMode == 'boolean' ? config.inheritDarkMode : false
// //
const app = this.apps.find(({name}) => name == config.name); const app = this.apps.find(({name}) => name == config.name);

View File

@ -1,5 +1,6 @@
<template> <template>
<div v-transfer-dom :data-transfer="true" :class="className"> <div v-transfer-dom :data-transfer="true">
<div :class="className">
<transition :name="transitions[0]"> <transition :name="transitions[0]">
<div v-if="value" class="micro-modal-mask" @click="onClose" :style="maskStyle"></div> <div v-if="value" class="micro-modal-mask" @click="onClose" :style="maskStyle"></div>
</transition> </transition>
@ -25,6 +26,7 @@
</div> </div>
</transition> </transition>
</div> </div>
</div>
</template> </template>
<script> <script>
@ -52,9 +54,9 @@ export default {
type: Boolean, type: Boolean,
default: false default: false
}, },
inheritDarkMode: { autoDarkTheme: {
type: Boolean, type: Boolean,
default: false default: true
}, },
beforeClose: Function beforeClose: Function
}, },
@ -65,11 +67,11 @@ export default {
} }
}, },
computed: { computed: {
className({value, transparent, inheritDarkMode}) { className({value, transparent, autoDarkTheme}) {
return { return {
'micro-modal': true, 'micro-modal': true,
'micro-modal-hidden': !value, 'micro-modal-hidden': !value,
'no-dark-content': !inheritDarkMode, 'no-dark-content': !autoDarkTheme,
'transparent-mode': transparent 'transparent-mode': transparent
} }
}, },
@ -146,7 +148,7 @@ export default {
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss">
.micro-modal { .micro-modal {
width: 100vw; width: 100vw;
height: 100vh; height: 100vh;
@ -177,10 +179,10 @@ export default {
} }
&-hidden { &-hidden {
animation: hidden-animation 0s forwards; animation: fade-hide 0s forwards;
animation-delay: 300ms; animation-delay: 300ms;
@keyframes hidden-animation { @keyframes fade-hide {
to { to {
display: none; display: none;
} }
@ -286,14 +288,20 @@ export default {
} }
} }
} }
</style>
<style lang="scss">
// //
body.dark-mode-reverse { body.dark-mode-reverse {
.micro-modal:not(.no-dark-content):not(.transparent-mode) { .micro-modal {
&:not(.transparent-mode) {
&:not(.no-dark-content) {
--modal-mask-bg: rgba(230, 230, 230, 0.6); --modal-mask-bg: rgba(230, 230, 230, 0.6);
--modal-close-color: #323232; --modal-close-color: #323232;
} }
&.no-dark-content {
--modal-mask-bg: rgba(20, 20, 20, 0.6);
--modal-body-background-color: #000000;
}
}
}
} }
</style> </style>

View File

@ -4676,7 +4676,7 @@ export default {
event.name += `_${menuItem.key}` event.name += `_${menuItem.key}`
} }
for (let key in menuItem) { for (let key in menuItem) {
if (['props', 'transparent', 'keepAlive', 'disableScopecss'].includes(key)) { if (['transparent', 'autoDarkTheme', 'keepAlive', 'disableScopecss'].includes(key)) {
event[key] = menuItem[key] event[key] = menuItem[key]
} }
} }