Showing
2 changed files
with
11 additions
and
15 deletions
... | ... | @@ -3,16 +3,17 @@ |
3 | 3 | <n-icon size="20" :depth="3"> |
4 | 4 | <fish-icon></fish-icon> |
5 | 5 | </n-icon> |
6 | + <!-- THINGS_KIT --> | |
6 | 7 | <n-text @click="handleFocus"> |
7 | 8 | 工作空间 - |
8 | - <n-button v-show="!focus" secondary round size="tiny"> | |
9 | + <n-button secondary round size="tiny"> | |
9 | 10 | <span class="title"> |
10 | 11 | {{ comTitle }} |
11 | 12 | </span> |
12 | 13 | </n-button> |
13 | 14 | </n-text> |
14 | 15 | |
15 | - <n-input | |
16 | + <!-- <n-input | |
16 | 17 | v-show="focus" |
17 | 18 | ref="inputInstRef" |
18 | 19 | size="small" |
... | ... | @@ -24,12 +25,12 @@ |
24 | 25 | v-model:value.trim="title" |
25 | 26 | @keyup.enter="handleBlur" |
26 | 27 | @blur="handleBlur" |
27 | - ></n-input> | |
28 | + ></n-input> --> | |
28 | 29 | </n-space> |
29 | 30 | </template> |
30 | 31 | |
31 | 32 | <script setup lang="ts"> |
32 | -import { ref, nextTick, computed } from 'vue' | |
33 | +import { ref, nextTick, computed,watchEffect } from 'vue' | |
33 | 34 | import { fetchRouteParamsLocation, setTitle } from '@/utils' |
34 | 35 | import { useChartEditStore } from '@/store/modules/chartEditStore/chartEditStore' |
35 | 36 | import { EditCanvasConfigEnum } from '@/store/modules/chartEditStore/chartEditStore.d' |
... | ... | @@ -41,17 +42,12 @@ const chartEditStore = useChartEditStore() |
41 | 42 | const focus = ref<boolean>(false) |
42 | 43 | const inputInstRef = ref(null) |
43 | 44 | |
44 | -// 根据路由 id 参数获取项目信息 | |
45 | -const fetchProhectInfoById = () => { | |
46 | - const id = fetchRouteParamsLocation() | |
47 | - if (id.length) { | |
48 | - return id[0] | |
49 | - } | |
50 | - return '' | |
51 | -} | |
52 | - | |
53 | -const title = ref<string>(fetchProhectInfoById() || '') | |
45 | +// THINGS_KIT | |
46 | +const title = ref<string>(fetchRouteParamsLocation()) | |
54 | 47 | |
48 | +watchEffect(() => { | |
49 | + title.value = chartEditStore.getProjectInfo.projectName || '' | |
50 | +}) | |
55 | 51 | const comTitle = computed(() => { |
56 | 52 | // eslint-disable-next-line vue/no-side-effects-in-computed-properties |
57 | 53 | title.value = title.value.replace(/\s/g, '') | ... | ... |