How can I remove Vue transition dynamically How can I remove Vue transition dynamically vue.js vue.js

How can I remove Vue transition dynamically


HTML

<transition name="condition ? 'fade' : ''">    <p>Hello</p></transition>

Specify the condition in the name attribute, when condition is true (or equal any value) run the "name" argument, in another case leave it empty and the transition will not work


You can use template with if-else condition:

<template v-if="condition">  <transition> <!-- if condition matched, use transition -->    <<html element>>  </transition></template><template v-else>   <<html element>></template>