It is easiest to load content when the page is first opened. Adding content to file When the vue instance is created, it is mounted into the div of If the route is switched excessively, you need to understand one first, the built-in component of ##
#default #fallback Similarly: (Switching of asynchronous components) vue3
name : Transition state (set The above is the detailed content of How vue3 solves the problem of excessive loading in each scene. For more information, please follow other related articles on the PHP Chinese website!is excessive content
加载中......
id='app'
through the.mount()
method, and theloading
content inside will be replaced;2. When routing is switched, asynchronous component loading
vue3
< Suspense>
;provides
2
slots????;
: A content to be loaded;
: A content to be displayed after loading;
加载中......
加载中......
built-in components
and
????
: Very simple, only one
is
displays the component, which can be used to switch components, such as:
: Content inserted in
Show/Hide
Add transition animation and splice it through thename
attribute
class
Such as:
attribute here
##anime-enter-active
hide=> show
transition time, etc. Parameters)anime-leave-active
: transition state (settingshow=> hide
transition time and other parameters)
anime-enter -from
=>anime-enter-to
Hide=> Show
start and end stylesanime-leave-from
= >anime-leave-to
Show=> Hide
Starting and ending styles