Vue common component caching problem

now there is a common component D, which is used in different components, A-> D B-> D c-> D, which displays A component by default. I now want to cache D component so that B and C components do not re-render D component when they are loaded. Is there anything you can do?

Mar.14,2021

use < keep-alive > to wrap component D, and then the corresponding activated and deactivated hooks will take effect

Menu