|
@@ -83,6 +83,8 @@
|
|
|
import CommentForm from './components/CommentForm'
|
|
import CommentForm from './components/CommentForm'
|
|
|
import CommentList from './components/CommentList'
|
|
import CommentList from './components/CommentList'
|
|
|
import CommentItem from './components/CommentItem'
|
|
import CommentItem from './components/CommentItem'
|
|
|
|
|
+import { childComment } from '@/api/comment/comment'
|
|
|
|
|
+
|
|
|
export default {
|
|
export default {
|
|
|
name: 'JuejinComment',
|
|
name: 'JuejinComment',
|
|
|
components: { CommentList, CommentItem, CommentForm },
|
|
components: { CommentList, CommentItem, CommentForm },
|
|
@@ -446,6 +448,18 @@ export default {
|
|
|
this.currentPage = page
|
|
this.currentPage = page
|
|
|
console.log('获取下一页子评论')
|
|
console.log('获取下一页子评论')
|
|
|
}
|
|
}
|
|
|
|
|
+ },
|
|
|
|
|
+ getChildComments(parentId) {
|
|
|
|
|
+ childComment(parentId, this.page).then(res => {
|
|
|
|
|
+ if (res.code === 0) {
|
|
|
|
|
+ this.page += 1
|
|
|
|
|
+ } else {
|
|
|
|
|
+ console.error(res.msg)
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ .catch(error => {
|
|
|
|
|
+ console.error(error.message)
|
|
|
|
|
+ })
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|