vue mustache语法

<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <script src="https://unpkg.com/vue/dist/vue.js"></script>
  </head>
  <body>
    <div id="app">
      <p>{{ message }}</p>
      <p>{{ message }} hi</p>
      <p>{{ firstName + ' ' + lastName}}</p>
      <p>{{ firstName}} {{lastName}}</p>
      <p>{{ count * 2 }}</p>
    </div>

    <script>
      new Vue({
        el: '#app',
        data: {
          message: 'Hello Vue.js!',
          firstName: "thomas",
          lastName: "zhang",
          count: 10
        },
      })
    </script>
  </body>
</html>

posted @ 2021-06-30 15:49  thomas_blog  阅读(45)  评论(0编辑  收藏  举报