(note) first note display

This commit is contained in:
2021-03-13 13:59:15 +01:00
parent b6d71227b6
commit c625db82c7
5 changed files with 117 additions and 190 deletions

View File

@@ -1,18 +1,35 @@
<template>
<div class="home">
<img alt="Vue logo" src="@/assets/logo.png" />
<HelloWorld msg="Welcome to OVA Template!" />
<p class="note" v-html="readme"></p>
</div>
</template>
<script lang="ts">
import { defineComponent } from 'vue'
import HelloWorld from '@/components/HelloWorld.vue'
import { defineComponent, watch, onUnmounted, nextTick } from 'vue'
import { useRepo } from '@/hooks/useRepo.hook'
import { useLinks } from '@/hooks/useLinks.hook'
export default defineComponent({
name: 'Home',
components: {
HelloWorld
setup() {
const { readme } = useRepo('jcalixte', 'notes')
const { listenToClick, removeListeners } = useLinks('note')
watch(readme, () => {
if (readme.value) {
nextTick(() => {
listenToClick()
})
}
})
onUnmounted(() => {
removeListeners()
})
return {
readme
}
}
})
</script>