|
@ -3,6 +3,30 @@ import { defineStore } from 'pinia' |
|
|
import type { homePageInterface } from '@/api' |
|
|
import type { homePageInterface } from '@/api' |
|
|
import dayjs from 'dayjs'; |
|
|
import dayjs from 'dayjs'; |
|
|
import { get } from '@/tools/request' |
|
|
import { get } from '@/tools/request' |
|
|
|
|
|
// 后台admin的store
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 前台blog的store
|
|
|
|
|
|
export const blogHeaderStore=defineStore('blogheader',()=>{ |
|
|
|
|
|
const show_author=ref(true) |
|
|
|
|
|
const show_menu=ref(false) |
|
|
|
|
|
const searchValue=ref("") |
|
|
|
|
|
return {show_author,show_menu,searchValue} |
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
export const blogContentStore=defineStore('blogcontent',()=>{ |
|
|
|
|
|
const isEmpty=ref(false) |
|
|
|
|
|
const isDisabled=ref(false) |
|
|
|
|
|
const getTitle = ref("") |
|
|
|
|
|
const titles = ref<{ title: string; lineIndex: string; indent: number }[]>([]); |
|
|
|
|
|
const setTitles=(newTitles: { title: string; lineIndex: string; indent: number }[])=> { |
|
|
|
|
|
titles.value = newTitles; |
|
|
|
|
|
} |
|
|
|
|
|
return {getTitle,setTitles,isEmpty,isDisabled} |
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
export const mainWrapperStore = defineStore("mainWrapper", () => { |
|
|
export const mainWrapperStore = defineStore("mainWrapper", () => { |
|
|
}) |
|
|
}) |
|
|
export const homePageStore = defineStore("homePage", () => { |
|
|
export const homePageStore = defineStore("homePage", () => { |
|
@ -30,8 +54,6 @@ export const homePageStore = defineStore("homePage", () => { |
|
|
isEmpty.value=false |
|
|
isEmpty.value=false |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}; |
|
|
}; |
|
|
const fetchHomeLabelPageList= async (query:any) => { |
|
|
const fetchHomeLabelPageList= async (query:any) => { |
|
|
// const response = await get(`/statistics/searchtitle?title=${query}`);
|
|
|
// const response = await get(`/statistics/searchtitle?title=${query}`);
|
|
|