mirror of
https://github.com/fastapiadmin/FastapiAdmin.git
synced 2026-10-07 02:01:37 +00:00
- 添加项目配置文件(tsconfig, eslint, prettier等) - 实现基础路由和页面布局 - 添加全局状态管理和API请求封装 - 集成UI组件库和主题系统 - 添加文档网站和示例页面 - 配置CI/CD和工作流
56 lines
1.2 KiB
Vue
56 lines
1.2 KiB
Vue
<script lang="ts" setup>
|
|
import { deepClone, isFunction } from 'wot-design-uni/components/common/util'
|
|
|
|
const { messageOptions, currentPage } = storeToRefs(useGlobalMessage())
|
|
|
|
const messageBox = useMessage('globalMessage')
|
|
const currentPath = getCurrentPath()
|
|
|
|
// #ifdef MP-ALIPAY
|
|
const hackAlipayVisible = ref(false)
|
|
|
|
nextTick(() => {
|
|
hackAlipayVisible.value = true
|
|
})
|
|
// #endif
|
|
|
|
watch(() => messageOptions.value, (newVal) => {
|
|
if (newVal) {
|
|
if (currentPage.value === currentPath) {
|
|
const option = deepClone(newVal)
|
|
messageBox.show(option).then((res) => {
|
|
if (isFunction(option.success)) {
|
|
option.success(res)
|
|
}
|
|
}).catch((err) => {
|
|
if (isFunction(option.fail)) {
|
|
option.fail(err)
|
|
}
|
|
})
|
|
}
|
|
}
|
|
else {
|
|
messageBox.close()
|
|
}
|
|
})
|
|
</script>
|
|
|
|
<script lang="ts">
|
|
export default {
|
|
options: {
|
|
virtualHost: true,
|
|
addGlobalClass: true,
|
|
styleIsolation: 'shared',
|
|
},
|
|
}
|
|
</script>
|
|
|
|
<template>
|
|
<!-- #ifdef MP-ALIPAY -->
|
|
<wd-message-box v-if="hackAlipayVisible" selector="globalMessage" />
|
|
<!-- #endif -->
|
|
<!-- #ifndef MP-ALIPAY -->
|
|
<wd-message-box selector="globalMessage" />
|
|
<!-- #endif -->
|
|
</template>
|