vue(1) first example

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



 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325054050&siteId=291194637