title: beforeDestroy vue dynamic component
body: <p>How could I add an alert message before switch the component? (<code>beforeDestroy</code> does not work until the path is changed...)</p>
  <pre><code>&lt;template&gt;
    &lt;keep-alive&gt;
      &lt;component :is=&quot;dynamicComponent&quot; /&gt;
    &lt;/keep-alive&gt;
  &lt;/template&gt;
  </code></pre>