Under what circumstances will vue execute the destruction hook in the life cycle?
巴扎黑2017-07-05 10:51:59
When the component is destroyed
<demo v-if="hasDemo"></demo>
Then when hasDemo
is changed from true to false, the destruction hook of the Demo component will be triggered.
Note that the v-show command does not destroy the element but only hides it, so this hook will not be triggered.