any86 / vue-error

常见vue3报错解决
2 stars 0 forks source link

Component inside <Transition> renders non-element root node that cannot be a #2

Open any86 opened 2 years ago

any86 commented 2 years ago

解决办法

看下里的页面是不是有多个根元素, 如果是改成一个, 比如下面的"A组件"包含多个根, 他就不可以放在""中.

// A.vue
<template>
    <p>1</p>
    <p>2</p>
</template>
// 错误
<transition>
  <A></A>
</transition>