Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
470 views
in Technique[技术] by (71.8m points)

评论功能前后端工作流程是啥?

评论功能是把数据发后端后,直接把要发的数据本地渲染到dom,还是发送后等后端返回新增的评论数据后再渲染到dom


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

肯定是先请求接口发送数据,等后端返回最新的评论数据再渲染到页面。如果没有等后端返回结果就直接渲染,当请求接口报错或者后端保存数据不成功时,就会出现前端显示的数据和数据库里的数据不一致的bug


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...