|
@@ -1,6 +1,6 @@
|
|
|
<template>
|
|
|
<a-layout-header class="web-header">
|
|
|
- <span style="color: #fff">头部</span>
|
|
|
+ <p class="title-font web-title">{{title}}</p>
|
|
|
<!-- logo -->
|
|
|
<!-- <router-link to="/"
|
|
|
custom
|
|
@@ -14,12 +14,14 @@
|
|
|
<!-- 站点搜索/添加 -->
|
|
|
<!-- <app-header-channel v-model:channel="current_site" /> -->
|
|
|
<!-- 用户操作 -->
|
|
|
- <!-- <app-header-user /> -->
|
|
|
+ <app-header-user v-if="user"
|
|
|
+ :name="user" />
|
|
|
</a-layout-header>
|
|
|
</template>
|
|
|
|
|
|
<script lang="ts">
|
|
|
-import { defineComponent, ref } from "vue";
|
|
|
+import useApp from "@/hooks/useApp";
|
|
|
+import { computed, defineComponent, reactive, ref, toRefs } from "vue";
|
|
|
|
|
|
import AppHeaderChannel from "./AppHeaderChannel.vue";
|
|
|
import AppHeaderUser from "./AppHeaderUser.vue";
|
|
@@ -30,10 +32,15 @@ const AppHeader = defineComponent({
|
|
|
AppHeaderUser,
|
|
|
},
|
|
|
setup() {
|
|
|
- let current_site = ref("jack");
|
|
|
+ const { store } = useApp();
|
|
|
+
|
|
|
+ const data = reactive({
|
|
|
+ user: computed(() => store.getters.user.nickname),
|
|
|
+ title: computed(() => store.getters.pageTitle),
|
|
|
+ });
|
|
|
|
|
|
return {
|
|
|
- current_site,
|
|
|
+ ...toRefs(data),
|
|
|
};
|
|
|
},
|
|
|
});
|