rfcs
rfcs copied to clipboard
Fragment component
Summary
Add a fragment built-in component to allow conditional transparent wrapping.
Examples
Conditional wrapper component
<template>
<WrapperComponent v-if="shouldWrap">
<img src="cat.jpg" alt="Cat" />
</WrapperComponent>
<img v-else src="cat.jpg" alt="Cat" />
</template>
fragment component
<template>
<component :is="shouldWrap ? WrapperComponent : 'fragment'">
<img src="cat.jpg" alt="Cat" />
</component>
</template>
Links
Important: Do NOT comment on this PR. Please use the discussion thread linked above to provide feedback, as it provides branched discussions that are easier to follow. This also makes the edit history of the PR clearer.
here I have the same problem.
https://github.com/vuejs/core/issues/3092
@pangao66 will be better to keep comments in discussion thread
Important: Do NOT comment on this PR. Please use the discussion thread linked above to provide feedback, as it provides branched discussions that are easier to follow. This also makes the edit history of the PR clearer.