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