vue 入门案例模版

vue 入门案例1

01.html

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

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>

  <div id="app">
    <p>{{ nickname }}</p>
    <p>{{ nickname.toUpperCase() }}</p>
    <p> {{ friend.name }} </p>
  </div>

  <script src="https://cdn.bootcdn.net/ajax/libs/vue/2.7.14/vue.js"></script>
  <script>
    const app = new Vue({
      el: '#app',
      data: {
        nickname: 'tony',
        age: 18,
        friend: {
          name: 'jack',
          desc: 'like study'
        }
      },
    }
    )

  </script>

</body>

</html>

vue 入门案例模版_第1张图片

nickname 遵守的是 js语法

你可能感兴趣的:(web_html,javascript)