In vue, how do I set up a function to be executed as soon as the page is loaded?

italic text
this is the js code for a page of article details. I would like to ask how to define a function that will be executed as soon as I jump to this page?


ide/instance.html-sharp%E7%94%9F%E5%91%BD%E5%91%A8%E6%9C%9F%E5%9B%BE%E7%A4%BA" rel=" nofollow noreferrer "> vue instance life cycle

is first executed in beforeCreate , and is at the same level as mounted

.

just write in created


usually the functions that need to be executed as soon as the page is loaded are put in created, but for specific analysis, you can refer to the upstairs documentation to understand the lifecycle usage scenario and then make a decision


lifecycle and routing processing can be done.
phases such as created for lifecycle, and navigation guards for
routing.


Lifecycle your requirements are usually written into created

Menu