vue(4)hello world
阿新 • • 發佈:2019-02-01
body urn div 數據 gui nbsp 運行 js文件 ejs
在前一章基礎上開發。
1、下載vue.js。(https://cn.vuejs.org/v2/guide/installation.html)
在hello-vue根目錄下創建js文件夾,並將該vue.js放入。
2、新建index2.html
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" > <title>第一個vue項目</title> <script src="js/vue.js"></script></head> <body> <div id="app"> <!-- 模板,用於展示數據 --> {{msg}} </div> <script> new Vue({ el:"#app", data() { return { msg:"hello 遙遠2!" } }, }) </script> </body> </html>
完整結構
最後,運行任務
vue(4)hello world