🔀 基础合并 三天后上传新版本

This commit is contained in:
江西小徐 2024-04-07 11:48:23 +08:00
parent 61275be2bf
commit 92d1600a6b
4 changed files with 32 additions and 0 deletions

View File

@ -12,6 +12,7 @@ Nuxt-Whois 是一个基于 Nuxt3、Tailwind CSS 和 Xep-Whois 构建的Whois查
## 更新说明
- 2024.4.7 增加 Go 后端 完善后台管理 增加用户自定义主题色 (目前基础合并,三天后会提交正式,禁止同步当前)
- 2024.3.25 抛弃原来 NuxtUi 改用 NaiveUi 重构中 后台增加中 当前版本无法上线使用
- 2024.3.18 重构V2版本 预计三天内完成。

View File

@ -0,0 +1,26 @@
// composables/useCurrentServer.js 或者在一个组件中
export const useCurrentServer = () => {
// 使用useHydration
useHydration('currentServer',
// 服务端执行的逻辑,返回初始值
() => {
return {
currentServer: {
whois: 'nuxt',
dns: 'nuxt',
domain: 'nuxt',
}
};
},
// 客户端执行的逻辑,接收服务端设置的值
(serverValue) => {
// 在客户端处理或使用服务端传来的值
console.log('Received from server:', serverValue);
// 这里你可以根据需要将serverValue设置到Pinia store或Vue响应式状态中
// 例如更新Pinia store中的状态
const configStore = useConfigStore();
configStore.setCurrentServer(serverValue);
}
);
}

View File

@ -1,5 +1,7 @@
<script setup lang="ts">
import {useCurrentServer} from "~/composables/useCurrentServer";
definePageMeta({
stylePage: true,
})

View File

@ -41,6 +41,9 @@ export const useConfigStore = defineStore('useConfig', {
this.configServer.domainArr = []
}
},
setCurrentServer(configServer: any) {
this.currentServer = configServer
},
setCurrentServerWhois(whois: any) {
this.currentServer.whois = whois
},