2.5.13
https://jsfiddle.net/_MT_/qzLptLvs/10/
[Vue warn]: <transition-group> children must be keyed: <element>
渲染失败
Seems to be a problem related to functional components and transition-group (changed the title)
The component doesn't get the key. You could wrap it like:
<transition-group tag="div" name="tag-list">
<div v-for="index in 5" :key="index">
<cpt-tag></cpt-tag>
</div>
</transition-group>
But why doesn't the function component get the key in the transition-group ?
It seems to be not implemented.
You see the warning because you simply did not pass key reference from the context object to the root element of the Tag component.
I'm so glad you're here sometimes @sqal 😉
pretty
<template functional>
</template>
https://codesandbox.io/s/rjjmpvwm4n
But how does a single file component bind context.data?
@sqal @posva @maxirozay
But how does a single file component bind context.data?
It's on the data object that the template receives:
<template functional>
<div :key='data.key' />
</template>
Most helpful comment
You see the warning because you simply did not pass
keyreference from thecontextobject to the root element of theTagcomponent.https://jsfiddle.net/7hy9sw7r/