Code:
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title> vue entry </ title> <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/vue.js"></script> </head> <body> <div id="first">{{msg}}</div> <script> new Vue({ // The id above is bound el refers to which dom node the vue instance is bound to el: " #first " , // mount point data:{ msg: " Learn about fitness swimming " } }) </script> </body> </html>
Effect:
(1) Pass
el:"#first" ,
will be bound to the dom with id="first",
(2)
The data mount point interacts with the data in {{ }}
2018-04-27 23:42:55