使用Vue的步驟:
1.引入vue.js(<script src="vuejs-2.5.16.js"></script>);
2.寫一個div,id設置為app;
3.寫js代碼:創建一個vue對象
new Vue({ el:"#app", data:{}, methods:{ }, axios.get("url?name=value").then(response=>{ //response.data就是響應數據 }) })
Vue is not defined瀏覽器報錯可能是:
1、<script src="vuejs-2.5.16.js"></script>未導入。其他js,axios包也一並導入進來
2、<script src="vuejs-2.5.16.js"></script>要放到web目錄下,注意不能放在src目錄。
