diff options
author | 135e2 <[email protected]> | 2022-08-07 22:41:49 +0800 |
---|---|---|
committer | 135e2 <[email protected]> | 2022-08-07 22:42:34 +0800 |
commit | 7ef7490538dd580ddab7734ae6609203391180e6 (patch) | |
tree | 8136f0ca8af4b7f796dbf134bccb4dddde7a86ee /src/components | |
parent | 56edcda3140e28ea6ade0c2f1760106592ed983b (diff) | |
download | otonashi-7ef7490538dd580ddab7734ae6609203391180e6.tar.gz otonashi-7ef7490538dd580ddab7734ae6609203391180e6.tar.bz2 otonashi-7ef7490538dd580ddab7734ae6609203391180e6.zip |
feat: implement nav-drawer & markdown parser
Diffstat (limited to 'src/components')
-rw-r--r-- | src/components/HomePage.vue | 33 | ||||
-rw-r--r-- | src/components/MainPage.vue | 21 | ||||
-rw-r--r-- | src/components/SubCard.vue | 6 |
3 files changed, 35 insertions, 25 deletions
diff --git a/src/components/HomePage.vue b/src/components/HomePage.vue new file mode 100644 index 0000000..9aaf6c4 --- /dev/null +++ b/src/components/HomePage.vue @@ -0,0 +1,33 @@ +<template> + <div class="d-flex align-end justify-start flex-row-reverse flex-wrap"> + <SubCard + class="ma-2 pa-2" + v-for="n in 6" + :key="n" + :content="markdownToHtml" + /> + </div> +</template> + +<script> +import SubCard from "./SubCard.vue"; +import { marked } from "marked"; + +export default { + name: "HomePage", + + components: { + SubCard, + }, + + computed: { + markdownToHtml() { + return marked(this.content); + }, + }, + + data: () => ({ + content: `~~Default content :D~~`, + }), +}; +</script> diff --git a/src/components/MainPage.vue b/src/components/MainPage.vue deleted file mode 100644 index 97dad53..0000000 --- a/src/components/MainPage.vue +++ /dev/null @@ -1,21 +0,0 @@ -<template> - <div class="d-flex align-end justify-start flex-row-reverse flex-wrap"> - <SubCard class="ma-2 pa-2" v-for="n in 6" :key="n" /> - </div> -</template> - -<script> -import SubCard from "./SubCard.vue"; - -export default { - name: "MainPage", - - components: { - SubCard, - }, - - data: () => ({ - // - }), -}; -</script> diff --git a/src/components/SubCard.vue b/src/components/SubCard.vue index 5b611f6..ab03ac3 100644 --- a/src/components/SubCard.vue +++ b/src/components/SubCard.vue @@ -2,9 +2,7 @@ <v-card variant="outlined"> <v-card-item> <v-card-title>{{ title }}</v-card-title> - <div class="text-caption"> - {{ content }} - </div> + <div v-html="content"></div> </v-card-item> </v-card> </template> @@ -14,7 +12,7 @@ export default { name: "SubCard", data: () => ({ title: "Default Title", - content: "Bruh", }), + props: ["content"], }; </script> |