(Official VueJS 01) Hello World

Vue.js 참조


디렉토리 생성

$ cd Desktop
$ mkdir test_vue


파일 생성

$ cd test_vue
$ touch test_vue.html


코드 작성

  • test_vue.html
<!DOCTYPE html>
<html>
  <head>
    <title>Hello VueJS</title>
  </head>
  <body>
    <div id="app">
      {{ message }}
    </div>
    
    <!-- Scripts -->
    <script src="https://cdn.jsdelivr.net/npm/vue"></script>
    <script>
      var app = new Vue({
        el: '#app',
        data: {
          message: 'Hello VueJS'
        }
      })
    </script>
  </body>
</html>

화면에 Hello VueJS가 표시된다.