valaxy-theme-hairy 1.2.5 → 1.2.7

Sign up to get free protection for your applications and to get access to all the features.
@@ -26,7 +26,7 @@ function displayTag(tag: string) {
26
26
  p="1"
27
27
  @click="displayTag(key.toString())"
28
28
  >
29
- {{ $t(key, {}, { missingWarn: false }) }}
29
+ {{ key ? $t(key, {}, { missingWarn: false }) : '' }}
30
30
  </a>
31
31
  </div>
32
32
  </div>
@@ -52,7 +52,7 @@ function displayCategory(keys: string | string[] = []) {
52
52
  class="dark:bg-dark-50 cursor-pointer border-none!"
53
53
  @click="$router.push(`/tags/${tag}`)"
54
54
  >
55
- {{ $t(tag, {}, { missingWarn: false }) }}
55
+ {{ tag ? $t(tag, {}, { missingWarn: false }) : '' }}
56
56
  </ElTag>
57
57
  </div>
58
58
  </div>
package/layouts/post.vue CHANGED
@@ -34,7 +34,7 @@ function displayTag(tag: string) {
34
34
  </div>
35
35
  <div v-if="post.tags?.length" class="tags flex-center gap-2 mt-2">
36
36
  <ElTag v-for="(tag) in post.tags" :key="tag" class="dark:bg-dark-50 cursor-pointer" @click="displayTag(tag)">
37
- {{ $t(tag, {}, { missingWarn: false }) }}
37
+ {{ tag ? $t(tag, {}, { missingWarn: false }) : '' }}
38
38
  </ElTag>
39
39
  </div>
40
40
  </template>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "valaxy-theme-hairy",
3
- "version": "1.2.5",
3
+ "version": "1.2.7",
4
4
  "packageManager": "pnpm@8.15.8",
5
5
  "author": {
6
6
  "email": "wwu710632@gmail.com",
@@ -17,7 +17,7 @@ const posts = computed<any[]>(() =>
17
17
  首页
18
18
  </HairyBreadcrumbItem>
19
19
  <HairyBreadcrumbItem>
20
- {{ $t(tag, {}, { missingWarn: false }) }}
20
+ {{ tag ? $t(tag, {}, { missingWarn: false }) : '' }}
21
21
  </HairyBreadcrumbItem>
22
22
  </HairyBreadcrumb>
23
23
  <ElTimeline>
@@ -1,7 +1,8 @@
1
1
  import { defineStore } from 'pinia'
2
2
  import { ref } from 'vue'
3
+ import { withGlobalPinia } from '../../utils'
3
4
 
4
- export const useGlobalStore = defineStore('global', () => {
5
+ const _useGlobalStore = defineStore('global', () => {
5
6
  const headerRef = ref<HTMLDivElement>()
6
7
  const showDrawer = ref(false)
7
8
 
@@ -10,3 +11,5 @@ export const useGlobalStore = defineStore('global', () => {
10
11
  showDrawer,
11
12
  }
12
13
  })
14
+
15
+ export const useGlobalStore = withGlobalPinia(_useGlobalStore)
package/utils/index.ts CHANGED
@@ -1,2 +1,3 @@
1
1
  export * from './size'
2
2
  export * from './util'
3
+ export * from './pinia'
package/utils/pinia.ts ADDED
@@ -0,0 +1,10 @@
1
+ import { createPinia } from 'pinia'
2
+
3
+ const pinia = createPinia()
4
+
5
+ export function withGlobalPinia<T>(useStore: T) {
6
+ const helper = (_pinia = pinia, hot: any) => (useStore as any)(pinia, hot)
7
+ return helper as unknown as T
8
+ }
9
+
10
+ export default pinia