vue v-model :

v-model:

Two-way binding through v-model, the data of data is bound to the input and rendered on the page

<!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">
       姓氏:<input v-model="firstname"/><br>
       名字:<input v-model="lastname"/>
       <div>{{firstname}}{{lastname}}</div>
  </div>
  <script>
      new View({
        el:"#first",
        data:{
           firstname:'',
           lastname:''
        }

      })
  </script>
</body>
</html>

  Effect:

 

 

 

 

 

 2018-05-01  23:40:46

Guess you like

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