fix: data.preview, data.value Object is possibly 'null'. (#63)

This commit is contained in:
mohen authored and GitHub committed 2022-11-02 17:36:40 +08:00
1 parent 5b74fdd684
commit aa66af82a8
1 file changed
+2 -2
+2 -2
View File
@@ -1,12 +1,12 @@
<script setup lang="ts"> <script setup lang="ts">
const { data } = await useFetch('/api/pageview') const { data } = await useFetch('/api/pageview')
const time = useTimeAgo(computed(() => data.value.startAt)) const time = useTimeAgo(computed(() => data.value!.startAt))
</script> </script>
<template> <template>
<div text-gray:80> <div text-gray:80>
<span font-500 text-gray>{{ data.pageview }}</span> <span font-500 text-gray>{{ data!.pageview }}</span>
page views since page views since
<span text-gray>{{ time }}</span> <span text-gray>{{ time }}</span>
</div> </div>