<div id="example">
<my-component text="first" v-if="test"></my-component>
<!-- expected mounted be called again, but not -->
<my-component text="second" v-else></my-component>
</div>
I expected after the test is set to false, my-component mounted method will be called again, so I can do some initialization. But it doesn't work as that.
Is it designed as that? or a bug?
Could someone give the related implementation(the related code)?
For v2.3.0,
HTML code:
js code:
I expected after the
test
is set tofalse
,my-component
mounted method will be called again, so I can do some initialization. But it doesn't work as that.Is it designed as that? or a bug?
Could someone give the related implementation(the related code)?