今天在使用vue框架搭建环境时,遇到这个错误提示:

[Vue warn]: Attribute "id" is ignored on component <div> because the component is a fragment instanc

 

这个提示的原因是使用 vue-router 和 vue-loader 插件的时候在最外面那个 template 里面,所有内容的外面没有使用一个div包起来。

 

如果没有使用div或者其他的元素包起来,vue-router 跳转时,vue不知道要删除哪些东西,所以才会报错。

相关文章:

  • 2021-12-24
  • 2021-04-20
  • 2021-08-25
  • 2022-12-23
  • 2021-12-10
  • 2021-06-20
  • 2022-01-25
  • 2022-02-28
猜你喜欢
  • 2021-06-03
  • 2022-12-23
  • 2021-07-06
  • 2021-08-03
  • 2021-11-10
  • 2022-12-23
  • 2021-08-22
相关资源
相似解决方案