|
@@ -3,7 +3,7 @@
|
|
<div v-if="detail">
|
|
<div v-if="detail">
|
|
<div class="breadcrumb my-[30px] pb-[20px] bb-1px_#EBEBEB" role="navigation">
|
|
<div class="breadcrumb my-[30px] pb-[20px] bb-1px_#EBEBEB" role="navigation">
|
|
<n-breadcrumb separator=">" v-if="breadcrumb">
|
|
<n-breadcrumb separator=">" v-if="breadcrumb">
|
|
- <!-- {{ breadcrumb }} -->
|
|
|
|
|
|
+ <!-- {{ breadcrumb }} -->
|
|
<template v-for="(bread, index) in breadcrumb" :key="index">
|
|
<template v-for="(bread, index) in breadcrumb" :key="index">
|
|
<n-breadcrumb-item :clickable="false"> {{ bread.title }}</n-breadcrumb-item>
|
|
<n-breadcrumb-item :clickable="false"> {{ bread.title }}</n-breadcrumb-item>
|
|
</template>
|
|
</template>
|
|
@@ -14,18 +14,9 @@
|
|
</div>
|
|
</div>
|
|
<div class="w-full flex flex-row flex-nowrap">
|
|
<div class="w-full flex flex-row flex-nowrap">
|
|
<div class="flex-basis-[240px] flex-grow-0 flex-shrink-0 br-1px_#EBEBEB">
|
|
<div class="flex-basis-[240px] flex-grow-0 flex-shrink-0 br-1px_#EBEBEB">
|
|
- <n-tree
|
|
|
|
- class="left-tree"
|
|
|
|
- v-if="mainCategories.children"
|
|
|
|
- block-line
|
|
|
|
- :data="mainCategories.children"
|
|
|
|
- :default-expanded-keys="defaultExpandedKeys"
|
|
|
|
- :node-props="nodeProps"
|
|
|
|
- key-field="id"
|
|
|
|
- label-field="title"
|
|
|
|
- children-field="children"
|
|
|
|
- selectable
|
|
|
|
- />
|
|
|
|
|
|
+ <n-tree class="left-tree" v-if="mainCategories.children" block-line :data="mainCategories.children"
|
|
|
|
+ :default-expanded-keys="defaultExpandedKeys" :node-props="nodeProps" key-field="id" label-field="title"
|
|
|
|
+ children-field="children" selectable />
|
|
<!-- <n-collapse class="br-1px_#EBEBEB py-[10px]">-->
|
|
<!-- <n-collapse class="br-1px_#EBEBEB py-[10px]">-->
|
|
<!-- <template v-for="(cate, index) in mainCategories.children" :key="index">-->
|
|
<!-- <template v-for="(cate, index) in mainCategories.children" :key="index">-->
|
|
<!-- <n-collapse-item :title="cate.title" :name="cate.title">-->
|
|
<!-- <n-collapse-item :title="cate.title" :name="cate.title">-->
|
|
@@ -45,8 +36,8 @@
|
|
<div class="bb-1px_#EBEBEB color-[#999999]">
|
|
<div class="bb-1px_#EBEBEB color-[#999999]">
|
|
<n-h1 class="font-700"> {{ detail.title }}</n-h1>
|
|
<n-h1 class="font-700"> {{ detail.title }}</n-h1>
|
|
<span class="flex flex-row gap-col-6 pb-[15px]">
|
|
<span class="flex flex-row gap-col-6 pb-[15px]">
|
|
- <p>发布于{{ dayjs(detail.createTime).format('YYYY-MM-DD') }}</p>
|
|
|
|
- <p>阅读 ( {{ detail.readCount }} )</p>
|
|
|
|
|
|
+ <p>{{ $t('publish') }} {{ dayjs(detail.createTime).format('YYYY-MM-DD') }}</p>
|
|
|
|
+ <p>{{ $t('read') }} ( {{ detail.readCount }} )</p>
|
|
</span>
|
|
</span>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
@@ -55,15 +46,10 @@
|
|
|
|
|
|
<div class="flex-basis-[240px] flex-grow-0 flex-shrink-0">
|
|
<div class="flex-basis-[240px] flex-grow-0 flex-shrink-0">
|
|
<div class="min-h-[200px] bg-[#F5F9FF] b-r-[8px] p-[20px]">
|
|
<div class="min-h-[200px] bg-[#F5F9FF] b-r-[8px] p-[20px]">
|
|
- <n-h4 class="font-600 ext-size-base">主要内容</n-h4>
|
|
|
|
|
|
+ <n-h4 class="font-600 ext-size-base">{{ $t('main_content') }}</n-h4>
|
|
<n-anchor :show-rail="false">
|
|
<n-anchor :show-rail="false">
|
|
- <n-anchor-link
|
|
|
|
- class="text-size-base color-[#999999]"
|
|
|
|
- v-for="(item, index) in mainContents"
|
|
|
|
- :key="index"
|
|
|
|
- :title="item.text"
|
|
|
|
- :href="`#my-section-${index + 1}`"
|
|
|
|
- >
|
|
|
|
|
|
+ <n-anchor-link class="text-size-base color-[#999999]" v-for="(item, index) in mainContents" :key="index"
|
|
|
|
+ :title="item.text" :href="`#my-section-${index + 1}`">
|
|
</n-anchor-link>
|
|
</n-anchor-link>
|
|
</n-anchor>
|
|
</n-anchor>
|
|
</div>
|
|
</div>
|
|
@@ -157,11 +143,11 @@ watchEffect(() => {
|
|
if (mainCategories.value) {
|
|
if (mainCategories.value) {
|
|
debugger
|
|
debugger
|
|
currentCate.value = findNodeById(
|
|
currentCate.value = findNodeById(
|
|
- mainCategories.value as unknown as TreeNode[] ||[],
|
|
|
|
|
|
+ mainCategories.value as unknown as TreeNode[] || [],
|
|
String(detail.value.categoryId),
|
|
String(detail.value.categoryId),
|
|
) as unknown as CategoryItem
|
|
) as unknown as CategoryItem
|
|
defaultExpandedKeys.value = [currentCate.value.parentId]
|
|
defaultExpandedKeys.value = [currentCate.value.parentId]
|
|
- breadcrumb.value = findBreadcrumbPath(mainCategories.value as unknown as TreeNode[] ||[], String(detail.value.categoryId))
|
|
|
|
|
|
+ breadcrumb.value = findBreadcrumbPath(mainCategories.value as unknown as TreeNode[] || [], String(detail.value.categoryId))
|
|
console.log('breadcrumb', breadcrumb.value)
|
|
console.log('breadcrumb', breadcrumb.value)
|
|
}
|
|
}
|
|
}
|
|
}
|