refactor: refactor for <script setup>

pull/190/head
Anthony Fu 4 years ago
parent eefbd76b7a
commit 5ba4ea2ef0

@ -8,11 +8,9 @@
</div> </div>
</template> </template>
<script lang="ts"> <script setup lang="ts">
import { defineComponent, ref, watch } from 'vue' import { ref, watch } from 'vue'
export default defineComponent({
setup() {
const el = ref<HTMLElement | null>(null) const el = ref<HTMLElement | null>(null)
const open = ref(false) const open = ref(false)
@ -21,13 +19,6 @@ export default defineComponent({
el.value!.scrollTop = 0 el.value!.scrollTop = 0
} }
}) })
return {
el,
open
}
}
})
</script> </script>
<style scoped> <style scoped>

@ -5,12 +5,10 @@
</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({
setup() {
const site = useSiteDataByRoute() const site = useSiteDataByRoute()
const page = usePageData() const page = usePageData()
@ -31,14 +29,6 @@ export default defineComponent({
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>
<style scoped> <style scoped>

@ -9,17 +9,9 @@
</footer> </footer>
</template> </template>
<script lang="ts"> <script setup lang="ts">
import { defineComponent } from 'vue'
import EditLink from './EditLink.vue' import EditLink from './EditLink.vue'
import LastUpdated from './LastUpdated.vue' import LastUpdated from './LastUpdated.vue'
export default defineComponent({
components: {
EditLink,
LastUpdated
}
})
</script> </script>
<style scoped> <style scoped>

Loading…
Cancel
Save