Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
corporate-culture-qd
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
王立鹏
corporate-culture-qd
Commits
7a811d04
Commit
7a811d04
authored
Oct 28, 2026
by
lijiabin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
【需求 25171】fix: 文章详情页等详情返回后再渲染评论区,修复 type 为 undefined 的 prop 警告
parent
0be8205c
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
5 deletions
+8
-5
index.vue
src/views/articleDetail/index.vue
+8
-5
No files found.
src/views/articleDetail/index.vue
View file @
7a811d04
...
@@ -12,6 +12,7 @@
...
@@ -12,6 +12,7 @@
<!-- 评论区 -->
<!-- 评论区 -->
<Comment
<Comment
v-if=
"articleDetail.type"
class=
"mt-6"
class=
"mt-6"
ref=
"commentRef"
ref=
"commentRef"
:id=
"id"
:id=
"id"
...
@@ -41,16 +42,18 @@ const initialCommentId = Number(route.query.commentId) || 0
...
@@ -41,16 +42,18 @@ const initialCommentId = Number(route.query.commentId) || 0
const
articleDetail
=
ref
({}
as
ArticleItemDto
)
const
articleDetail
=
ref
({}
as
ArticleItemDto
)
const
initPage
=
()
=>
{
const
initPage
=
()
=>
{
Promise
.
allSettled
([
getArticleDetail
(
id
)]).
then
(([
r1
])
=>
{
Promise
.
allSettled
([
getArticleDetail
(
id
)]).
then
(
async
([
r1
])
=>
{
if
(
r1
.
status
===
'fulfilled'
)
{
if
(
r1
.
status
===
'fulfilled'
)
{
articleDetail
.
value
=
r1
.
value
.
data
articleDetail
.
value
=
r1
.
value
.
data
// 评论区要等文章详情(拿到 type)回来才渲染,所以定位也放到渲染之后
await
nextTick
()
if
(
initialCommentId
)
{
commentRef
.
value
?.
locateComment
(
initialCommentId
)
}
}
}
})
})
}
}
onMounted
(
async
()
=>
{
onMounted
(()
=>
{
initPage
()
initPage
()
if
(
initialCommentId
)
{
commentRef
.
value
?.
locateComment
(
initialCommentId
)
}
})
})
</
script
>
</
script
>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment