vue 的http请求方法---自带的vue-resource 先用命令安装库 cnpm install vue-resource --save-dev main.js home.vue post方法 如果方法不放到 methods里面,那么访问页面就会执行函数