分辨率設(shè)置成默認(rèn) , mac 下是 win + 0
windows的文件名是gbk的
el-form
需要接收一個model
,并且需要配合el-form-item
一起使用,并且在el-form-item
上綁定prop
屬性,resetField
方法才能好使。
<el-form :model="addServiceData" ref="addServiceForm">
<el-form-item label="手機(jī)號" prop="mobile">
<el-input v-model="data.mobile" placeholder="請輸入手機(jī)號碼"></el-input>
</el-form-item>
</el-form>
并且addServiceData應(yīng)該是個對象,定義在data里面,類似這樣
data(){
return {
addServiceData: {
mobile: ''
}
}
}
文檔里有寫啊
https://zh.nuxtjs.org/api
asyncData 可以接受一個 context 參數(shù),包含了當(dāng)前環(huán)境所有信息
context.store
就能獲取到 vuex 實例了,具體內(nèi)容打開鏈接進(jìn)去看吧
找到問題所在了,大圖的寬應(yīng)該等于小圖寬乘以 放大圖的預(yù)覽圖除以放大鏡的寬, 高同理,上面的代碼自己改一部分就可以
*上面的
bigImage.width = bigImage.offsetWidth * percent;
bigImage.height = bigImage.offsetHeight * percent;
改為
bigImage.width = container.offsetWidth * percent;
bigImage.height = container.offsetHeight * percent;
即可,昨天寫到太晚,迷迷糊糊地沒發(fā)現(xiàn)
給props里傳一個loadLimitLocations方法
curl
能訪問就不是nodejs的問題了,應(yīng)該還是防火墻的問題,先看看端口通不通
telnet ip port
computed中的計算屬性需要有一個返回值,你這里看似
有返回值,但是返回到哪里去了?
無論是then還是catch中的返回都是傳遞到Promise的下一個狀態(tài)中,不能作為provinceList的返回值,就是不拿es6的Promise來說,函數(shù)嵌套,內(nèi)層函數(shù)的返回值也不會作為外層函數(shù)的返回值返回出去
你這個可以在鉤子函數(shù)中請求到數(shù)據(jù)后,在賦值到provinceList上去
你需要看一下數(shù)組更新檢測
數(shù)組的更新,需要手動進(jìn)行更新
pc web端的直播跟node和php都沒有半毛錢關(guān)系。直接http hls要不就rtmp了。用腳本語言去處理視頻流數(shù)據(jù)太不適合了,有更加專業(yè)的ffmpeg和c和go
感覺你不適合程序員......
jquery 和 angular 的ajax請求上還是存在差異的
http://victorblog.com/2012/12...
提到在客戶端改變angularJS默認(rèn)傳輸格式為Content-Type: x-www-form-urlencoded。
很清楚啊,input type不支持動態(tài),用v-if代替
<input v-if="isNewpwd" type="text" v-model='newPwd' placeholder="請輸入你的密碼"/>
<input v-else type="password" v-model='newPwd' placeholder="請輸入你的密碼"/>
請問解決了嗎?我也碰到了,是react的項目
packageInfoList.forEach(package => {
var newPackage = ConfigData.getGoods(true, package.id);
package.packageTag.forEach(tag => {
var newTag = newPackage.packageTag.find(t => t.id === tag.id);
if(!newTag) return;
tag.goods.forEach(goods => {
var newGoods = newTag.goods.find(g => g.id === goods.id);
if(!newGoods) return;
var flag = updateGoodAttr(goods, newGoods);
});
});
});
updateGoodAttr = (goods, newGoods) => {
goods.attr.forEach(attr => {
var newAttr = newGoods.attr.find(a => a.id === attr.id)
attr.option.filter(taste => !!taste.select).foreach(taste => {
var newTasteOption = newAttr.option.find(t => t.id === taste.id);
if(newTasteOption) {
newTasteOption.select = taste.select;
}
});
});
}
已經(jīng)省去里很多迭代的下角標(biāo)處理里,但是代碼還是很啰嗦,頻繁重復(fù)對兩個數(shù)組進(jìn)行元素比較。干脆把這個邏輯提取出來:
var match = (arr1, arr2, identifier, process) => arr1.forEach(item1 =>
arr2.forEach(item2 => identifier(item1) === identifier(item2) && process(item1, item2))
);
傳入兩個數(shù)組,對數(shù)組元素的每個元素使用 identifier 獲取 id,如果比較成功,則調(diào)用 process 函數(shù)處理這兩個元素。例子中 identifier 都一樣,即 item => item.id
.
var ID = item => item.id;
var processPackage = (p1, p2) => match(p1.packageTag, p2.packageTag, ID, processTag);
var processTag = (tag1, tag2) => match(tag1.goods, tag2.goods, ID, processGoods);
var processGoods = (goods1, goods2) => match(goods1,attr, goods2.attr, ID, processAttr);
var processAttr = (attr1, attr2) => match(attr1.options.filter(taste => !!taste.select), attr2.options, ID, processTaste);
var processTaste = (taste1, taste2) => taste2.select = taste1.select
var packageInfoList = [...], configPackageList = [...];
match(packageInfoList, configPackageList, ID , processPackage);
目前代碼中還存在重復(fù)地調(diào)用 match
函數(shù),調(diào)用邏輯相似而重復(fù),如果能把這塊抽出來就好了。我們再提取一個函數(shù),用來構(gòu)造 processXXX
。processAttr
比較特殊,對兩邊取子屬性的邏輯不一樣,所以提取的這個函數(shù)需要考慮 processAttr
的需求。
var subProcess = ([s1, s2], id, process) => (i1, i2) => match(s1(i1), s2(i2), id, process)
var fixSelector = f => Array.isArray(f) ? f : [f, f]
var processTaste = (taste1, taste2) => taste2.select = taste1.select
var processAttr = subProcess(
fixSelector([item => item.options.filter(taste => !!taste.select), item => item.options]),
ID,
processTaste
)
var processGoods = subProcess(fixSelector(item => item.attr), ID, processAttr)
var processTag = subProcess(fixSelector(item => item.goods), ID, processGoods)
var processPackage = subProcess(fixSelector(item => item.tag), ID, processTag)
var ID = item => item.id
match(
packageInfoList,
configPackageList,
ID,
processPackage
);
最后一步調(diào)用其實等價于:
subProcess(fixSelector([() => packageInfoList, () => configPackageList], ID,
subProcess( fixSelector(package => package.tag), ID
subProcess( fixSelector(tag => tag.goods), ID,
subProcess( fixSelector(goods => goods.attr), ID
subProcess( fixSelector([attr => attr.options.filter(taste => !!taste.select), attr => attr.options]), ID
processTaste
)
)
)
)
)()
把掉套函數(shù)調(diào)用拉平試試?試想如下代碼:
f(a, f(b, f(c, f(d, e)))))
// 等價于
[a,b,c,d,e].reduceRight((prev, item) => f(item, prev))
于是有:
var match = (arr1, arr2, identifier, process) => arr1.forEach(item1 =>
arr2.forEach(item2 => identifier(item1) === identifier(item2) && process(item1, item2))
)
var subProcess = ([s1, s2], id, process) => (i1, i2) => match(s1(i1), s2(i2), id, process)
// 為了傳遞 selector 的時候可以單獨給一個函數(shù)
var fixSelector = f => Array.isArray(f) ? f : [f, f]
var reducer = (prev, [selector, identifier]) => subProcess(fixSelector(selector), identifier, prev)
var process = (...items) => items.reduceRight(reducer)()
// 調(diào)用
process(
[ [() => packageInfoList, () => configPackageList], ID], // 初始數(shù)據(jù)
[ package => package.tag, ID], // 根據(jù)上面一項的元素,返回需要繼續(xù)比對的下一層數(shù)據(jù)
[ tag => tag.goods, ID], // 把ID當(dāng)參數(shù)在每一層傳進(jìn)來是為了支持不同層取 ID 的方式不同
[ goods => goods.attr, ID], // 再深也不怕,無非多一個參數(shù)
// 支持兩邊不同的取值方法
[ [attr => attr.options.filter(taste => !!taste.select), attr => attr.options], ID],
// 最后一個函數(shù)就是你處理深處數(shù)據(jù)的地方啦
(taste1, taste2) => taste2.select = taste1.select
)
雖然調(diào)用的時候挺漂亮的,但是有點繞。。。
下面加了url:'/api'也是這樣
事實上,JS的所有數(shù)據(jù)都是 double 型的,也就是64位浮點型,并按照IEEE754標(biāo)準(zhǔn)進(jìn)行保存。
但是在做位運算的時候要對兩個數(shù)進(jìn)行 toInt32
進(jìn)行類型轉(zhuǎn)換(>>>
是toUint32
), 然后按照32位整型的bits 進(jìn)行位運算,運算結(jié)果也是按照Int32
或是Uint32
進(jìn)行解釋,再轉(zhuǎn)換成double
function toUint32(x) { return x>>>0;}
function toInt32(x) { return x>>0;}
toUint32(-1); // 4294967295 === 2^32 - 1
toInt32(-1); // -1
toInt32(1.21); // 1
具體可一參考 ES標(biāo)準(zhǔn):http://www.ecma-international...
call是改變identify的this指向,具體指到誰,還要看你的sayHello方法是怎么被調(diào)用,被誰調(diào)用的,調(diào)用的時候用沒用call、apply方法。
寫一個閉包變量儲存menu狀態(tài)
let handler (function (){
var isSlidedown = false
return {
isSlidedown = ! isSlidedown
//業(yè)務(wù)寫這里
}
})();
btn.addEventListener('click', handler)
北大青鳥APTECH成立于1999年。依托北京大學(xué)優(yōu)質(zhì)雄厚的教育資源和背景,秉承“教育改變生活”的發(fā)展理念,致力于培養(yǎng)中國IT技能型緊缺人才,是大數(shù)據(jù)專業(yè)的國家
北大青鳥中博軟件學(xué)院創(chuàng)立于2003年,作為華東區(qū)著名互聯(lián)網(wǎng)學(xué)院和江蘇省首批服務(wù)外包人才培訓(xùn)基地,中博成功培育了近30000名軟件工程師走向高薪崗位,合作企業(yè)超4
中公教育集團(tuán)創(chuàng)建于1999年,經(jīng)過二十年潛心發(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),是中國一站式人才培養(yǎng)平臺、一站式人才輸送平臺。2014年4月3日在美國成功上市,融資1
曾工作于聯(lián)想擔(dān)任系統(tǒng)開發(fā)工程師,曾在博彥科技股份有限公司擔(dān)任項目經(jīng)理從事移動互聯(lián)網(wǎng)管理及研發(fā)工作,曾創(chuàng)辦藍(lán)懿科技有限責(zé)任公司從事總經(jīng)理職務(wù)負(fù)責(zé)iOS教學(xué)及管理工作。
浪潮集團(tuán)項目經(jīng)理。精通Java與.NET 技術(shù), 熟練的跨平臺面向?qū)ο箝_發(fā)經(jīng)驗,技術(shù)功底深厚。 授課風(fēng)格 授課風(fēng)格清新自然、條理清晰、主次分明、重點難點突出、引人入勝。
精通HTML5和CSS3;Javascript及主流js庫,具有快速界面開發(fā)的能力,對瀏覽器兼容性、前端性能優(yōu)化等有深入理解。精通網(wǎng)頁制作和網(wǎng)頁游戲開發(fā)。
具有10 年的Java 企業(yè)應(yīng)用開發(fā)經(jīng)驗。曾經(jīng)歷任德國Software AG 技術(shù)顧問,美國Dachieve 系統(tǒng)架構(gòu)師,美國AngelEngineers Inc. 系統(tǒng)架構(gòu)師。