|
|
@ -5,39 +5,29 @@
|
|
|
|
</p>
|
|
|
|
</p>
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<script lang="ts">
|
|
|
|
<script setup lang="ts">
|
|
|
|
import { defineComponent, ref, computed, onMounted } from 'vue'
|
|
|
|
import { ref, computed, onMounted } from 'vue'
|
|
|
|
import { useSiteDataByRoute, usePageData } from 'vitepress'
|
|
|
|
import { useSiteDataByRoute, usePageData } from 'vitepress'
|
|
|
|
|
|
|
|
|
|
|
|
export default defineComponent({
|
|
|
|
const site = useSiteDataByRoute()
|
|
|
|
setup() {
|
|
|
|
const page = usePageData()
|
|
|
|
const site = useSiteDataByRoute()
|
|
|
|
|
|
|
|
const page = usePageData()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const datetime = ref('')
|
|
|
|
const datetime = ref('')
|
|
|
|
|
|
|
|
|
|
|
|
const hasLastUpdated = computed(() => {
|
|
|
|
const hasLastUpdated = computed(() => {
|
|
|
|
const lu = site.value.themeConfig.lastUpdated
|
|
|
|
const lu = site.value.themeConfig.lastUpdated
|
|
|
|
|
|
|
|
|
|
|
|
return lu !== undefined && lu !== false
|
|
|
|
return lu !== undefined && lu !== false
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
const prefix = computed(() => {
|
|
|
|
const prefix = computed(() => {
|
|
|
|
const p = site.value.themeConfig.lastUpdated
|
|
|
|
const p = site.value.themeConfig.lastUpdated
|
|
|
|
|
|
|
|
|
|
|
|
return p === true ? 'Last Updated' : p
|
|
|
|
return p === true ? 'Last Updated' : p
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
onMounted(() => {
|
|
|
|
onMounted(() => {
|
|
|
|
datetime.value = new Date(page.value.lastUpdated).toLocaleString('en-US')
|
|
|
|
datetime.value = new Date(page.value.lastUpdated).toLocaleString('en-US')
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return {
|
|
|
|
|
|
|
|
hasLastUpdated,
|
|
|
|
|
|
|
|
prefix,
|
|
|
|
|
|
|
|
datetime
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
})
|
|
|
|
})
|
|
|
|
</script>
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|