Having mounted() only run once on a component Vue.js : <p>I have two components that conditionally render with <code>v-if</code>:</p>

<pre><code>&lt;Element v-if="this.mode === 'mode'"/&gt;
&lt;OtherElement v-if="this.mode !== 'mode'"/&gt;
</code></pre>

<p>I have load-in animations for both components that I have under <code>mounted()</code>, that I only want to run the <em>first</em> time they are loaded. But with mounted, each time the component is recreated when <code>this.mode</code> changes, the animations trigger again. How can I avoid this?</p>
