diff --git a/src/components/home.vue b/src/components/home.vue index 3b3af18..7e18b7b 100644 --- a/src/components/home.vue +++ b/src/components/home.vue @@ -35,6 +35,30 @@ export default { created() { setTimeout(() => { this.handleHide() + + // $http.get('/user', { + // params: { + // ID: 12345 + // } + // }) + // .then(function (response) { + // console.log(response); + // }) + // .catch(function (error) { + // console.log(error); + // }); + + // $http.post('/user', { + // firstName: 'Fred', + // lastName: 'Flintstone' + // }) + // .then(function (response) { + // console.log(response); + // }) + // .catch(function (error) { + // console.log(error); + // }); + // 模拟请求 // this.$fetch('/api/v2/movie/top250').then((response) => { // console.log(response) diff --git a/src/main.js b/src/main.js index 9fa9737..c95a61d 100644 --- a/src/main.js +++ b/src/main.js @@ -7,6 +7,8 @@ import store from './store/store' import 'lib-flexible/flexible.js' import fastclick from 'fastclick' import './styles/reset.css' +import axios from 'axios' +Vue.prototype.$http = axios fastclick.attach(document.body)