亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

javascript - How to split components reasonably in vue? What kind of module should be a separate component?
學(xué)習(xí)ing
學(xué)習(xí)ing 2017-06-12 09:32:33
0
1
794

Recently I am writing a small web chat application, with a main interface and a chat page. The content is not complicated. The first time I tried to write with Vue, I divided the personal information at the head of the main interface, the list in the middle, the friend category switching at the bottom, and the text of the chat interface opened by clicking on the list item, the message panel, etc., all into separate components.
But this seems to cause more child-parent component communication. The leader said that I don’t need to write these in separate components. The idea of ????components is reuse, but I don’t need to reuse these. But when I look at demos on the Internet, different functional modules are separated into individual components.


So I hope you can help me figure out the logic, how to optimize the component segmentation of this chat function, and how to understand the idea of ??component reuse?

學(xué)習(xí)ing
學(xué)習(xí)ing

reply all(1)
學(xué)霸

My understanding is that since it is written as a component, it means that this component will be used in other places. Otherwise, there is no point in taking it out and it will cause more trouble for yourself. If you think the page has a lot of content, you can extract the css and js to write.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template