vuejs / vue

This is the repo for Vue 2. For Vue 3, go to https://github.com/vuejs/core
http://v2.vuejs.org
MIT License
207.72k stars 33.67k forks source link

Allow Component Tag in Transition Group #5095

Open ralphchristianeclipse opened 7 years ago

ralphchristianeclipse commented 7 years ago

Allow this kind of feature for transition-group or transition

<transition-group tag="todo-layout-container">
    <!-- Which will render a component rather a tag -->
</transition-group>

and will compile to


<todo-layout-container>

</todo-layout-container>

and compiles to what is inside of the todo-layout-container

let Todo = Vue.extend({
   name: 'todo-layout-container',
   methods: {
      //Per todo methods
   }
});
Uriziel01 commented 7 years ago

That would be great! No more unwanted div's used just for transitions.

DrSensor commented 6 years ago

Also, it would be helpful to add support for passing props/event/attributes. Something like

<transition-group tag="todo-layout-container"
                  :props="someValue" 
                  @event="someMethod()" 
                  class="css-class"
>

  <!-- Which will render a component rather a tag -->

</transition-group>

will compile to

<todo-layout-container :props="someValue" @event="someMethod()" class="css-class">

</todo-layout-container>