確實(shí),按照正常情況來(lái)講的,當(dāng)this為object時(shí),this.message是絕對(duì)不會(huì)報(bào)錯(cuò)的。
然鵝js不會(huì)欺騙你,那么這個(gè)鍋只能讓vue來(lái)背了。
你可以點(diǎn)擊控制臺(tái)報(bào)錯(cuò)的這一行,查看拋出錯(cuò)誤的vue代碼,也就是vue.esm.js?a026:3297:at VueComponent.proxyGetter [as trigger] (vue.esm.js?a026:3297)
然后你會(huì)發(fā)現(xiàn),代碼大概是這樣的:
var sharedPropertyDefinition = {
enumerable: true,
configurable: true,
get: noop,
set: noop
};
function proxy (target, sourceKey, key) {
sharedPropertyDefinition.get = function proxyGetter () {
return this[sourceKey][key] // 是這里報(bào)錯(cuò)了 sourceKey為_(kāi)props, key為message
};
sharedPropertyDefinition.set = function proxySetter (val) {
this[sourceKey][key] = val;
};
Object.defineProperty(target, key, sharedPropertyDefinition);
}
重點(diǎn)在于return this[sourceKey][key]
。
實(shí)際上this.message
調(diào)用的并不是vue實(shí)例對(duì)象下的message屬性,而是this._props.message
。
而this._props
在此時(shí)(beforeCreate)是undefined
的。
這跟vue的生命周期有關(guān),可以看這個(gè)圖:https://cn.vuejs.org/images/l...。
And,如果你在created
鉤子中console.log(this)
,你會(huì)發(fā)現(xiàn)this
下是會(huì)有message
屬性的...(也有_props.message)。
是因?yàn)樯厦尜N出的代碼中有這一段:Object.defineProperty(target, key, sharedPropertyDefinition);
target是當(dāng)前vue實(shí)例,key是message這一類(lèi)的props。
( vue用了defineProperty
把this.message
指向了this._props.message
。)
所以,我們還可以做一個(gè)試驗(yàn):
created() {
console.log(this._props) // object
console.log(this.message, 11) // 'message content'
delete this._props.message
console.log(this.message, 22) // undefined
}
不一定非要在main.js里抓取每一次的router變動(dòng),只要在login頁(yè)面做處理就可以解決問(wèn)題。
在login頁(yè)里添加:
methods: {},
beforeRouteEnter (to, from, next) {
if (!getToken()) { // 這里檢查是否獲取到cookie
next()
} else {
next({
path:"/"
})
}
}
js去構(gòu)造后端需要的數(shù)組,foreach你下拉列表中拿到的[2,3](舉個(gè)例子),每次將{appId:foreachItem,direction:1}放到一個(gè)數(shù)組變量里,最后將這個(gè)數(shù)組傳遞給后端
用docker容器啟數(shù)據(jù)庫(kù)服務(wù)的話,需要將數(shù)據(jù)庫(kù)的數(shù)據(jù)掛載到宿主機(jī)上,否則每次重啟容器都會(huì)導(dǎo)致數(shù)據(jù)丟失。
可以使用-v參數(shù)將mysql的數(shù)據(jù)目錄/var/lib/mysql掛載到宿主機(jī)的某個(gè)目錄下,就可以持久化數(shù)據(jù)。
這東西能力還有待提升,我之前一個(gè)項(xiàng)目用這個(gè),在安卓上就沒(méi)毛病 IOS上就有的樣式錯(cuò)亂
前端
axios.post('/post',{data:表1數(shù)據(jù),data2:表2數(shù)據(jù)});
后端(KOA為例,需要koa-bodyparser中間件)
const {data,data2} = ctx.request.body;
const [model,model2] = await Promise.all([Model.create(data),Model2.create(data2)]);
C++來(lái)湊個(gè)熱鬧。
#include <algorithm>
#include <iostream>
#include <iterator>
#include <vector>
template <class It>
std::vector<std::vector<int>> Solution(It first, It last) {
std::vector<std::vector<int>> result;
while (first != last) {
auto ite = std::adjacent_find(first, last, [](int l, int r) {return l != r-1;});
if (ite != last)
++ite;
if (std::distance(first, ite) > 1)
result.emplace_back(first, ite);
first = ite;
}
return result;
}
int main() {
std::vector<int> vtr = {1, 2, 3, 5, 1, 2, 1};
for (const auto &result : Solution(vtr.begin(), vtr.end())) {
std::copy(result.begin(), result.end(), std::ostream_iterator<int>(std::cout, " "));
std::cout << std::endl;
}
return 0;
}
1.首先瀏覽器是請(qǐng)求http://localhost:8080/abc/signup/video
沒(méi)錯(cuò)的,發(fā)出去的請(qǐng)求被dev-server收到,然后轉(zhuǎn)發(fā)到目標(biāo)地址,相當(dāng)于代理
2.不生效是你的配置不對(duì),你主要配置最終請(qǐng)求地址應(yīng)該是http://122.79.10.259:8080/signup/video
代碼確實(shí)有點(diǎn)問(wèn)題,我寫(xiě)了一個(gè)
const temp = {};
for (item in dateInfo) {
const val = dateInfo[item]
const str1 = item.match(/(\S*)_/)[1];
if (!temp[str1]) {
temp[str1] = {};
temp[str1][item] = val;
} else {
temp[str1][item] = val
}
}
const new_arr = Object.values(temp);
console.log(new_arr);
用 svg 畫(huà)。
AJAX獲取COOKIE的話是要后端設(shè)置cookie并返回的
我這里出現(xiàn)了一個(gè)錯(cuò)誤就是,在使用 php 執(zhí)行這個(gè)定時(shí)文件的過(guò)程中,會(huì)報(bào)錯(cuò)。使用curl就沒(méi)問(wèn)題了。即在安裝postfix的情況下,修改定時(shí)文件的內(nèi)容為*/1 * * * * curl http://localhost/ds.php
即可
測(cè)試下了你的DEMO,你的TOP計(jì)算有點(diǎn)問(wèn)題
你吧所有圖片 換一張等比例的圖片,你就知道問(wèn)題了
根據(jù)自己的理解回復(fù)(不對(duì)的地方請(qǐng)大家指出來(lái),一起學(xué)習(xí)):
1.xdebug.remote_host
表示綁定客戶(hù)端 host
,默認(rèn)為 localhost
2.PHPStorm
設(shè)置里面的 server
表示要監(jiān)聽(tīng)的服務(wù),host
為要監(jiān)聽(tīng)的主機(jī)地址,本機(jī)填寫(xiě) localhost
就可以
3.DBGp Proxy
代理配置,不用管
4.xdebug helper
非必要,laradock
環(huán)境下不用安裝也可以進(jìn)行 Xdebug
斷點(diǎn)調(diào)試
'@\components\new_medication_history\drug_arrangement.vue'
試試這個(gè)
貌似你這個(gè)報(bào)錯(cuò)不是因?yàn)榻M件引用錯(cuò)誤吧
下面不是說(shuō)你缺 vue-style-loader ...什么的嗎
要不嘗試重啟mongo服務(wù)
北大青鳥(niǎo)APTECH成立于1999年。依托北京大學(xué)優(yōu)質(zhì)雄厚的教育資源和背景,秉承“教育改變生活”的發(fā)展理念,致力于培養(yǎng)中國(guó)IT技能型緊缺人才,是大數(shù)據(jù)專(zhuān)業(yè)的國(guó)家
北大青鳥(niǎo)中博軟件學(xué)院創(chuàng)立于2003年,作為華東區(qū)著名互聯(lián)網(wǎng)學(xué)院和江蘇省首批服務(wù)外包人才培訓(xùn)基地,中博成功培育了近30000名軟件工程師走向高薪崗位,合作企業(yè)超4
中公教育集團(tuán)創(chuàng)建于1999年,經(jīng)過(guò)二十年潛心發(fā)展,已由一家北大畢業(yè)生自主創(chuàng)業(yè)的信息技術(shù)與教育服務(wù)機(jī)構(gòu),發(fā)展為教育服務(wù)業(yè)的綜合性企業(yè)集團(tuán),成為集合面授教學(xué)培訓(xùn)、網(wǎng)
達(dá)內(nèi)教育集團(tuán)成立于2002年,是一家由留學(xué)海歸創(chuàng)辦的高端職業(yè)教育培訓(xùn)機(jī)構(gòu),是中國(guó)一站式人才培養(yǎng)平臺(tái)、一站式人才輸送平臺(tái)。2014年4月3日在美國(guó)成功上市,融資1
曾工作于聯(lián)想擔(dān)任系統(tǒng)開(kāi)發(fā)工程師,曾在博彥科技股份有限公司擔(dān)任項(xiàng)目經(jīng)理從事移動(dòng)互聯(lián)網(wǎng)管理及研發(fā)工作,曾創(chuàng)辦藍(lán)懿科技有限責(zé)任公司從事總經(jīng)理職務(wù)負(fù)責(zé)iOS教學(xué)及管理工作。
浪潮集團(tuán)項(xiàng)目經(jīng)理。精通Java與.NET 技術(shù), 熟練的跨平臺(tái)面向?qū)ο箝_(kāi)發(fā)經(jīng)驗(yàn),技術(shù)功底深厚。 授課風(fēng)格 授課風(fēng)格清新自然、條理清晰、主次分明、重點(diǎn)難點(diǎn)突出、引人入勝。
精通HTML5和CSS3;Javascript及主流js庫(kù),具有快速界面開(kāi)發(fā)的能力,對(duì)瀏覽器兼容性、前端性能優(yōu)化等有深入理解。精通網(wǎng)頁(yè)制作和網(wǎng)頁(yè)游戲開(kāi)發(fā)。
具有10 年的Java 企業(yè)應(yīng)用開(kāi)發(fā)經(jīng)驗(yàn)。曾經(jīng)歷任德國(guó)Software AG 技術(shù)顧問(wèn),美國(guó)Dachieve 系統(tǒng)架構(gòu)師,美國(guó)AngelEngineers Inc. 系統(tǒng)架構(gòu)師。