♻️ (store) use a store to store readme and files

This commit is contained in:
2021-03-24 21:23:23 +01:00
parent 165cfb96e7
commit e199c68d68
18 changed files with 202 additions and 229 deletions

View File

@@ -9,9 +9,8 @@
</template>
<script lang="ts">
import { useQueryStackedNotes } from '@/hooks/useQueryStackedNotes.hook'
import { useFolderNotes } from '@/modules/note/hooks/useFolderNotes'
import { defineAsyncComponent, defineComponent, onMounted, toRefs } from 'vue'
import { defineAsyncComponent, defineComponent } from 'vue'
const FluxNote = defineAsyncComponent(() => import('@/components/FluxNote.vue'))
@@ -26,18 +25,8 @@ export default defineComponent({
user: { type: String, required: true },
repo: { type: String, required: true }
},
setup(props) {
const refProps = toRefs(props)
const { content } = useFolderNotes(
DRAFT_FOLDER,
refProps.user,
refProps.repo
)
const { resetStackedNotes } = useQueryStackedNotes()
onMounted(() => {
resetStackedNotes()
})
setup() {
const { content } = useFolderNotes(DRAFT_FOLDER)
return {
content

View File

@@ -14,9 +14,8 @@
</template>
<script lang="ts">
import { useQueryStackedNotes } from '@/hooks/useQueryStackedNotes.hook'
import { useFolderNotes } from '@/modules/note/hooks/useFolderNotes'
import { defineAsyncComponent, defineComponent, onMounted, toRefs } from 'vue'
import { defineAsyncComponent, defineComponent } from 'vue'
const FluxNote = defineAsyncComponent(() => import('@/components/FluxNote.vue'))
@@ -31,18 +30,8 @@ export default defineComponent({
user: { type: String, required: true },
repo: { type: String, required: true }
},
setup(props) {
const refProps = toRefs(props)
const { content } = useFolderNotes(
FLEETING_NOTES_FOLDER,
refProps.user,
refProps.repo
)
const { resetStackedNotes } = useQueryStackedNotes()
onMounted(() => {
resetStackedNotes()
})
setup() {
const { content } = useFolderNotes(FLEETING_NOTES_FOLDER)
return {
content

View File

@@ -6,13 +6,7 @@
</template>
<script lang="ts">
import {
defineComponent,
defineAsyncComponent,
computed,
toRefs,
watch
} from 'vue'
import { defineComponent, defineAsyncComponent, computed } from 'vue'
import { useQueryStackedNotes } from '@/hooks/useQueryStackedNotes.hook'
const FluxNote = defineAsyncComponent(() => import('@/components/FluxNote.vue'))
@@ -32,13 +26,8 @@ export default defineComponent({
repo: { type: String, required: false, default: '' }
},
setup(props) {
const refProps = toRefs(props)
const { resetStackedNotes } = useQueryStackedNotes()
watch([refProps.user, refProps.repo], () => {
resetStackedNotes()
})
return {
resetStackedNotes,
routeKey: computed(() => `${props.user}-${props.repo}`)