valaxy-theme-press 0.22.13 → 0.22.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,9 +2,8 @@
2
2
  import { useI18n } from 'vue-i18n'
3
3
  import { useEditLink } from '../composables'
4
4
 
5
- const editLink = useEditLink()
6
-
7
5
  const { t } = useI18n()
6
+ const editLink = useEditLink()
8
7
  </script>
9
8
 
10
9
  <template>
@@ -3,10 +3,11 @@ import { useData } from 'valaxy'
3
3
  import { computed, onMounted, ref, watchEffect } from 'vue'
4
4
  import { useI18n } from 'vue-i18n'
5
5
 
6
- const data = useData()
6
+ const { t } = useI18n()
7
+ const { page } = useData()
7
8
 
8
- const date = computed(() => new Date(data.lastUpdated!))
9
- const isoDatetime = computed(() => date.value.toISOString())
9
+ const date = computed(() => new Date(page.value.lastUpdated!))
10
+ const isoDatetime = computed(() => date.value?.toISOString())
10
11
  const datetime = ref('')
11
12
 
12
13
  // set time on mounted hook because the locale string might be different
@@ -17,7 +18,6 @@ onMounted(() => {
17
18
  datetime.value = date.value.toLocaleString(window.navigator.language)
18
19
  })
19
20
  })
20
- const { t } = useI18n()
21
21
  </script>
22
22
 
23
23
  <template>
@@ -10,7 +10,7 @@ const { t } = useI18n()
10
10
  </script>
11
11
 
12
12
  <template>
13
- <div class="menu-link">
13
+ <div class="menu-link w-full">
14
14
  <AppLink
15
15
  v-if="'link' in item"
16
16
  class="menu-item"
@@ -24,7 +24,7 @@ const { t } = useI18n()
24
24
 
25
25
  <style lang="scss" scoped>
26
26
  .menu-link{
27
- .menu-item {
27
+ .menu-item {
28
28
  display: flex;
29
29
  width: 100%;
30
30
  border-radius: 6px;
@@ -1,2 +1,4 @@
1
1
  export * from './config'
2
- export * from './edit-link'
2
+ export * from './nav'
3
+ export * from './sidebar'
4
+ export * from './useEditLink'
@@ -4,10 +4,11 @@ import { useThemeConfig } from '.'
4
4
 
5
5
  export function useEditLink() {
6
6
  const themeConfig = useThemeConfig()
7
+ const { page } = useData()
8
+
7
9
  return computed(() => {
8
10
  const { text, pattern } = themeConfig.value.editLink || {}
9
- const { relativePath } = useData()
10
- const url = pattern.replace(/:path/g, relativePath)
11
+ const url = pattern.replace(/:path/g, page.value.relativePath)
11
12
 
12
13
  return { url, text }
13
14
  })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "valaxy-theme-press",
3
- "version": "0.22.13",
3
+ "version": "0.22.15",
4
4
  "description": "Docs Theme for Valaxy",
5
5
  "author": {
6
6
  "email": "me@yunyoujun.cn",
@@ -26,6 +26,6 @@
26
26
  "@docsearch/js": "^3.9.0"
27
27
  },
28
28
  "devDependencies": {
29
- "valaxy": "0.22.13"
29
+ "valaxy": "0.22.15"
30
30
  }
31
31
  }