Vue文件地址:html
<script src="https://cdn.jsdelivr.net/npm/vue@2.5.16/dist/vue.js"></script>
代碼:vue
<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 Course</title> <script src="Vue.min.js"></script> <script> window.onload = () => { const App = new Vue({ el: '#main', data: { message: '456465Hello Vue!', } }); } </script> </head> <body> <div id="main"> {{ message }} </div> </body> </html>
選擇器能夠是id選擇器或者是類選擇器。npm
使用前(在運行時)要確保Vue文件已經加載完成再而後進行其餘操做(代碼加載的順序是很重要的)。ui