Are el bindings in vue bound to block-level elements at the top level?

<div id="abc">
    
    

..... </div>

Xiaobai doesn"t quite understand:

first, do you want to manipulate the el of the content in div? do you just bind it to -sharpabc ? Instead of binding each element.

second, if you want to manipulate the contents of another div, do you want to re-create new Vue ({}) , and then operate

Mar.07,2021

el is a mount point, if el:'-sharpabc', then all functions in this Vue instance can operate in the elements contained in-sharpabc.
if you want to manipulate the contents of another div, there is no relationship between this div and-sharpabc this div can be regenerated into an instance new Vue ({}). If there is a relationship, you can also directly use id='abc'


1, Yes;
2, Yes. But you can also mount it on the outermost layer. Don't you need to mount it many times?


you can think of it as a scope.
< div id= "app" >
once the div is turned into a vue element, everything in it can be controlled by vue.
but because vue is often used for single-page applications, it's usually fine to mount one.
but if you want to do a multi-page application, each page needs to be mounted, or it doesn't matter if you can mount multiple vue elements on one page, but this is not necessary

.
Menu