合规国际互联网加速 OSASE为企业客户提供高速稳定SD-WAN国际加速解决方案。 广告
# vue的生命周期 ``` <pre class="calibre15">``` <span class="token2">export</span> <span class="token2">default</span> <span class="token1">{</span> name<span class="token1">:</span> <span class="token4">'Login'</span><span class="token1">,</span> <span class="token3">created</span> <span class="token1">(</span><span class="token1">)</span> <span class="token1">{</span> console<span class="token1">.</span><span class="token3">log</span><span class="token1">(</span><span class="token4">'登录页面被创建'</span><span class="token1">)</span> <span class="token1">}</span><span class="token1">,</span> <span class="token3">updated</span> <span class="token1">(</span><span class="token1">)</span> <span class="token1">{</span> console<span class="token1">.</span><span class="token3">log</span><span class="token1">(</span><span class="token4">'登录页面被更新'</span><span class="token1">)</span> <span class="token1">}</span><span class="token1">,</span> <span class="token3">beforeDestroy</span> <span class="token1">(</span><span class="token1">)</span> <span class="token1">{</span> console<span class="token1">.</span><span class="token3">log</span><span class="token1">(</span><span class="token4">'登录页面即将被销毁'</span><span class="token1">)</span> <span class="token1">}</span><span class="token1">,</span> <span class="token3">destroyed</span> <span class="token1">(</span><span class="token1">)</span> <span class="token1">{</span> console<span class="token1">.</span><span class="token3">log</span><span class="token1">(</span><span class="token4">'登录页面被销毁'</span><span class="token1">)</span> <span class="token1">}</span><span class="token1">,</span> <span class="token3">activated</span> <span class="token1">(</span><span class="token1">)</span> <span class="token1">{</span> console<span class="token1">.</span><span class="token3">log</span><span class="token1">(</span><span class="token4">'登录页面活跃'</span><span class="token1">)</span> <span class="token1">}</span><span class="token1">,</span> <span class="token3">deactivated</span> <span class="token1">(</span><span class="token1">)</span> <span class="token1">{</span> console<span class="token1">.</span><span class="token3">log</span><span class="token1">(</span><span class="token4">'登录页面不活跃'</span><span class="token1">)</span> <span class="token1">}</span> <span class="token1">}</span> ``` ```