axios.defaults.baseURL = 'http://192.168.1.118:808';
axios.defaults.withCredentials = true;
axios.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded';
http://www.ituring.com.cn/article/200275html
.withCredentials()方法能夠激活發送原始cookie的能力,不過只有在Access-Control-Allow-Origin不是一個通配符(*),而且Access-Control-Allow-Credentials爲’true’的狀況下才行.打包
npm adduservue
若是長時間不登陸,可能會過時,使用 npm login 進行登陸就能夠 publish 了。node
npm publishios
若是使用淘寶的源(http://cnodejs.org/topic/4f9904f9407edba21468f31e),則不能使用 npm publish。 須要切回 npmjs 源: git
npm config set registry http://registry.npmjs.org/es6
Element-ui修改
1. 下載源碼:https://github.com/ElemeFE/elementgithub
2. 參考說明:https://github.com/ElemeFE/element/blob/master/.github/CONTRIBUTING.zh-CN.mdexpress
3. focknpm
4. git pullelement-ui
5. commit & push
發佈本身的Vue庫以 element-ui 爲基礎,提交源碼以後,不能立刻就加入新功能。 把 element-ui 下載一份, 全局替換: element-ui => element-ui-yxh
1. npm install
2. 修改源碼,修改版本號,遞增
3. npm build dist
4. npm adduser
5. npm publish
Promise.reject錯誤捕獲http://www.uedsc.com/296729.html
Vue2攔截器
vue2自帶的攔截器,已被 axios 替代: https://github.com/mzabriskie/axios
try { Vue.http.interceptors.push(function (request, next) { // ... // 請求發送前的處理邏輯 // ... var getFullUrl = function (url) { if (url.slice(0, 2) == "//") return url; if (url[0] != "/") { url = "/" + url; } return "//172.30.8.132:808" + url; } // request.method = "JSONP"; request.url = getFullUrl(request.url); next(function (response) { if (response.status == 200) { if (response.body && response.body.msg) { this.$message.error(response.body.msg); return new Promise(function (resolve, reject) { reject(response); }); } } else if (response.status == 500) { this.$message.error(response.body); // throw new Error("Error"); return new Promise(function (resolve, reject) { reject(response); }); } return; }) }); } catch (e) { //console.info("Vue.http.interceptors:" + e.message); }
問題
Object.assign(this.$data,this.$options.data());
html: <input ref="name" /> //js:像這樣: this.info.name = "OK" this.$refs["name"].$propData["value"].express = "info.name";
var d = VueComponent;
d.$vnode.data.model.expression
https://www.zhihu.com/question/41127712/answer/252388995
devtool: '#eval-source-map'
版本
npm 組件版本真是害人啊。
https://majing.io/posts/10000022041170
No parser and no file path given, couldn't infer a parser.
升級 vue-loader 到 14.2.3+
IE11 , Symbol 未定義的錯誤:
安裝: es6-symbol
做者:NewSea 如無特別標記說明,均爲NewSea原創,版權私有,翻載必糾。歡迎交流,轉載,但要在頁面明顯位置給出原文鏈接。謝謝。 |