admin管理员组

文章数量:1320865

I seriously don't know, why the fragments is the problem.

<template>
   <div id="page">
   </div>

   <div class="some">
   </div>
</template>

[Vue warn]: Attribute "id" is ignored on ponent "div"

I seriously don't know, why the fragments is the problem.

<template>
   <div id="page">
   </div>

   <div class="some">
   </div>
</template>

[Vue warn]: Attribute "id" is ignored on ponent "div"

Share Improve this question asked May 3, 2016 at 13:40 Ladislav JanečekLadislav Janeček 1392 silver badges10 bronze badges
Add a ment  | 

2 Answers 2

Reset to default 10

You need to wrap the contents of your template in another div. When it es to render it, it needs the single root element to replace

<template>
 <div>
   <div id="page">
   </div>

   <div class="some">
   </div>
  </div>
</template>

Vue v3 now supports multi-root templates. Your code should work out-of-the-box.

https://v3-migration.vuejs/new/fragments.html

本文标签: javascriptVuejs fragment instanceStack Overflow