呵呵噠我就
?axios報(bào)錯(cuò)系列(ajax $http)
1.報(bào)錯(cuò) Cannot read property ‘protocol’ of undefined
axios 不能通過(guò)Vue.use(axios)的方式引入, 如果想在所有組件中直接使用axios, 可以這樣設(shè)置(main.js)
import axios from 'axios';
Vue.prototype.$http = axios;
2. 跨域錯(cuò)誤
在config index.js 設(shè)置如下代理?
記得重啟一次 npm run dev
proxyTable: {'/list': {target:'http://api.xxxxxxxx.com',pathRewrite: {'^/list':'/list'}? }
使用遮罩層的時(shí)候 還是可以滾動(dòng) 怎么辦?
同時(shí)要定住body
document.body.style.position='fixed'
document.body.style.top='0'