Skip to content

Commit

Permalink
fix: 冗余代码修改
Browse files Browse the repository at this point in the history
  • Loading branch information
JeromeD3 committed Feb 6, 2023
1 parent 5dec77d commit 7b2457b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"name": "Apache 2.0",
"url": "https://www.apache.org/licenses/LICENSE-2.0.html"
},
"x-generation-date": "2023-02-05T09:35:18.646Z"
"x-generation-date": "2023-02-06T05:44:46.596Z"
},
"x-strapi-config": {
"path": "/documentation",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,11 +125,11 @@ watch(isNavShown, (val) => {
onMounted(() => {
headerHeight = document.querySelector('.main-header').clientHeight
const route = useRoute()
window.addEventListener('scroll', onScroll)
window.addEventListener('scroll', scrollFixedCatalogue)
setTimeout(() => {
window.scroll(0, 0)
window.addEventListener('scroll', onScroll)
window.addEventListener('scroll', scrollFixedCatalogue)
firtstCatalogueTop.value = document.querySelector('.sticky-block-box').offsetTop
if (route.hash) {
const hashIndex = route.hash.slice(9)
if (hashIndex !== -1) {
Expand All @@ -139,7 +139,6 @@ onMounted(() => {
a.click()
}
}
firtstCatalogueTop.value = document.querySelector('.sticky-block-box').offsetTop
}, 1)
})
Expand Down
7 changes: 2 additions & 5 deletions frontend/components/ArticlesContent/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import themeStyle from './themeStyle'
import highlightStyle from './highlightStyle'
import type { IArticle } from '~~/types/IArticle'
const props = defineProps({
defineProps({
article: {
type: Object as () => IArticle,
required: true,
Expand All @@ -38,9 +38,6 @@ function transformToId() {
}
}
const route = useRoute()
const url = ref(`/api/articles/${route.params.id}`)
const { data: articleData } = await useFetch(url)
onMounted(() => {
transformToId()
})
Expand Down Expand Up @@ -82,7 +79,7 @@ const { immerseState } = useImmerse()
<div itemprop="articleBody" class="article-content">
<div class="break-all lh-1.75em; fw-400 text-15px color-[#333]; overflow-x-hidden cache bg-jj-light">
<Viewer id="markdown-body" :value="articleData.article.content" :plugins="plugins" />
<Viewer id="markdown-body" :value="article.content" :plugins="plugins" />
</div>
</div>
</article>
Expand Down

0 comments on commit 7b2457b

Please sign in to comment.