Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
应用程序中不同页面的最佳实践是什么,例如从菜单中调用。
你会在 DOM 中为这个页面创建一个新页面并销毁旧页面,还是隐藏旧页面更好(当然可以更多)?
或者还有其他更好的方法吗?
谢谢云母
这取决于所有视图都插入到 DOM 中但隐藏时的 DOM 大小。如果它太大,插入/删除可能更有意义,否则只需显示/隐藏。它还取决于显示其他视图的概率。