Bind Vue on body or others element

后端 未结 2 1510
暖寄归人
暖寄归人 2020-12-16 13:07

I\'ve seen many times Vue instance is bind on body tag. Other times this is bind on a div id

I\'m asking when i should use body

2条回答
  •  南笙
    南笙 (楼主)
    2020-12-16 13:53

    You should never use the body tag. In fact, it raises a warning to use the body tag.

    Added a warning when mounting the root instance to body or html. This is no longer recommended in 2.0.

    This is from the release notes, anyways it's incorrect, it raises an error.

提交回复
热议问题