u
This commit is contained in:
1 parent
dc885119a0
commit
f98c280ac4
44 files changed
+19617
-18
No files matched your search
@@ -48,7 +48,7 @@ const postComments = ref<PostComment[]>([])
|
||||
const anchorMenu = ref<AnchorMenuItem[]>([
|
||||
{
|
||||
label: '目录',
|
||||
href: 'anchro',
|
||||
href: 'menu',
|
||||
children: [],
|
||||
},
|
||||
{
|
||||
@@ -179,7 +179,7 @@ function getTotalCommentCount(list: PostComment[]): number {
|
||||
|
||||
<div class="post-center">
|
||||
<div class="post-main">
|
||||
<div class="post-title">
|
||||
<div id="menu" class="post-title">
|
||||
{{ postDetail.title }}
|
||||
</div>
|
||||
<div class="post-meta">
|
||||
@@ -202,7 +202,7 @@ function getTotalCommentCount(list: PostComment[]): number {
|
||||
<WandEditor v-model="postDetail.content" mode="view" @update:directory="handleUpdateEditorDirectory" />
|
||||
</div>
|
||||
|
||||
<div class="post-comment">
|
||||
<div class="post-comment" id="comment">
|
||||
<div class="divider" />
|
||||
|
||||
<div class="post-comment-title">
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<script lang="ts" setup>
|
||||
import type { PostTag } from '@/types/base'
|
||||
import type { PublicPost, QueryPublicPostParams } from '@/types/post'
|
||||
import type { PostTag, PublicPost, QueryPublicPostParams } from '@/types/post'
|
||||
|
||||
import { Search } from '@element-plus/icons-vue'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { onMounted, reactive, ref, watch } from 'vue'
|
||||
@@ -13,10 +13,10 @@ import { useCommonStore } from '@/store/common'
|
||||
import { formatPostTime } from '@/utils/time'
|
||||
|
||||
const router = useRouter()
|
||||
const { postTagOptionsWithAll } = useCommonStore()
|
||||
const commonStore = useCommonStore()
|
||||
|
||||
const activeNames = ref(['1'])
|
||||
const selectedTag = ref<PostTag | null>(null)
|
||||
const selectedTag = ref<PostTag | null>(commonStore.postTagOptionsWithAll[0])
|
||||
|
||||
const tableData = ref<PublicPost[]>([])
|
||||
|
||||
@@ -38,16 +38,6 @@ onMounted(() => {
|
||||
queryPost()
|
||||
})
|
||||
|
||||
watch(
|
||||
postTagOptionsWithAll,
|
||||
(list) => {
|
||||
if (list.length && !selectedTag.value) {
|
||||
selectedTag.value = list[0]
|
||||
}
|
||||
},
|
||||
{ immediate: true },
|
||||
)
|
||||
|
||||
function handleChangeSelectedTag(tag: PostTag) {
|
||||
selectedTag.value = tag
|
||||
|
||||
@@ -107,7 +97,7 @@ function toDetail(data: PublicPost) {
|
||||
<el-collapse-item title="标签" name="1">
|
||||
<ul class="tag-list">
|
||||
<li
|
||||
v-for="item in postTagOptionsWithAll"
|
||||
v-for="item in commonStore.postTagOptionsWithAll"
|
||||
:key="item.id"
|
||||
class="tag-item"
|
||||
:class="{ active: selectedTag && (selectedTag.id === item.id) }"
|
||||
|
||||
Reference in new issue
Block a user