Home  >  Q&A  >  body text

javascript - Under what circumstances will vue execute the destruction hook in the life cycle?

Under what circumstances will vue execute the destruction hook in the life cycle?

大家讲道理大家讲道理2662 days ago927

reply all(1)I'll reply

  • 巴扎黑

    巴扎黑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.

    reply
    0
  • Cancelreply