Bind Vue on body or others element

后端 未结 2 1504
暖寄归人
暖寄归人 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:51

    The accepted answer is correct: binding the main Vue instance on body element is really not recommended!

    For more information:

    • Why it's not recommended to render to element (related to React, but similar principle applies to Vue too)

提交回复
热议问题