学习视频:https://www.bilibili.com/video/BV1HE411e7vY?p=3

代码:

<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Vue基础</title>
</head>

<body>
  <div id="app">
    {{ message }}
  </div>
  <div id="test">
    {{message}}
  </div>
  <!-- 开发环境版本,包含了有帮助的命令行警告 -->
  <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
  <script>
    var app = new Vue({
      el:"#app",
      data:{
        message:" 你好 小黑! "
      }
    })
    var test = new Vue({
      el:'#test',
      data:{
        message:'test'
      }
    })
  </script>
</body>

</html>

 

posted on 2021-01-31 17:00  月零Ray  阅读(150)  评论(0编辑  收藏  举报