从 Durandal 缓存中清除视图
Clear views from the Durandal cache
使用选项 cacheViews: true
时,Durandal 会缓存视图。即留在 DOM 和 shows/hides 中。在我们应用程序的一个用例中,我想从 DOM 中清除它们,以便重新加载它们。
有谁知道是否可行,如果可行,如何实现?
"There's currently no support directly in Durandal for that." - Rob Eisenberg
解决方法是您必须使用 jQuery 从 DOM 中删除缓存视图,Durandal 将在下一次合成时重新加载它。
使用选项 cacheViews: true
时,Durandal 会缓存视图。即留在 DOM 和 shows/hides 中。在我们应用程序的一个用例中,我想从 DOM 中清除它们,以便重新加载它们。
有谁知道是否可行,如果可行,如何实现?
"There's currently no support directly in Durandal for that." - Rob Eisenberg
解决方法是您必须使用 jQuery 从 DOM 中删除缓存视图,Durandal 将在下一次合成时重新加载它。