因?yàn)槟鉻ype屬性的值是動(dòng)態(tài)的,所以用v-bind:type 簡(jiǎn)寫為:type
你腳本是不是放在head里面的
不知道你的任務(wù)是什么類型的計(jì)算,樓上已經(jīng)回復(fù)es6的用法,那給你提供另外一種es5的方法吧,你可以試試用setTimeout代替setInterval,比如:
function do() {
setTimeout(function () {
/*做點(diǎn)什么*/
do();
},0)
}
do();
這樣的好處是讓do每次執(zhí)行都變成一個(gè)異步任務(wù),插入到任務(wù)隊(duì)列中,沒(méi)那么容易阻塞進(jìn)程。
keyup事件,keyup時(shí)判斷是否符合正則,不符合replace掉
font-size: unit(@i,px)到網(wǎng)上找了個(gè)解決高德偏移量的代碼 https://blog.csdn.net/woshimu...
我的是ip定位 轉(zhuǎn)換過(guò)的定位就準(zhǔn)確了
this.map.plugin('AMap.Geolocation', function () {
geolocation = new AMap.Geolocation({
enableHighAccuracy: true, //是否使用高精度定位,默認(rèn):true
timeout: 10000, //超過(guò)10秒后停止定位,默認(rèn):無(wú)窮大
maximumAge: 0, //定位結(jié)果緩存0毫秒,默認(rèn):0
showButton: true, //顯示定位按鈕,默認(rèn):true
buttonPosition: 'LB', //定位按鈕停靠位置,默認(rèn):'LB',左下角
buttonOffset: new AMap.Pixel(10, 20), //定位按鈕與設(shè)置的??课恢玫钠屏?,默認(rèn):Pixel(10, 20)
showMarker: true, //定位成功后在定位到的位置顯示點(diǎn)標(biāo)記,默認(rèn):true
panToLocation: true, //定位成功后將定位到的位置作為地圖中心點(diǎn),默認(rèn):true
zoomToAccuracy: true, //定位成功后調(diào)整地圖視野范圍使定位位置及精度范圍視野內(nèi)可見,默認(rèn):false
});
_this.map.addControl(geolocation);
geolocation.getCurrentPosition();
AMap.event.addListener(geolocation, 'complete', function (data) {
var gpsPoint = GPS.gcj_encrypt(data.position.getLat(), data.position.getLng());
_this.centerPointer = gpsPoint;
_this.circleArea(gpsPoint);
_this.getAddress(gpsPoint);
});
AMap.event.addListener(geolocation, 'error', function () {
alert('定位失敗');
});
});
var GPS = {
PI: 3.14159265358979324,
x_pi: 3.14159265358979324 * 3000.0 / 180.0,
delta: function (lat, lon) {
var a = 6378245.0; // a: 衛(wèi)星橢球坐標(biāo)投影到平面地圖坐標(biāo)系的投影因子。
var ee = 0.00669342162296594323; // ee: 橢球的偏心率。
var dLat = this.transformLat(lon - 105.0, lat - 35.0);
var dLon = this.transformLon(lon - 105.0, lat - 35.0);
var radLat = lat / 180.0 * this.PI;
var magic = Math.sin(radLat);
magic = 1 - ee * magic * magic;
var sqrtMagic = Math.sqrt(magic);
dLat = (dLat * 180.0) / ((a * (1 - ee)) / (magic * sqrtMagic) * this.PI);
dLon = (dLon * 180.0) / (a / sqrtMagic * Math.cos(radLat) * this.PI);
return {
'lat': dLat,
'lon': dLon
};
},
//WGS-84 to GCJ-02
gcj_encrypt: function (wgsLat, wgsLon) {
if (this.outOfChina(wgsLat, wgsLon))
return {
'lat': wgsLat,
'lon': wgsLon
};
var d = this.delta(wgsLat, wgsLon);
return {
'lat': wgsLat + d.lat,
'lon': wgsLon + d.lon
};
},
outOfChina: function (lat, lon) {
if (lon < 72.004 || lon > 137.8347)
return true;
if (lat < 0.8293 || lat > 55.8271)
return true;
return false;
},
transformLat: function (x, y) {
var ret = -100.0 + 2.0 * x + 3.0 * y + 0.2 * y * y + 0.1 * x * y + 0.2 * Math.sqrt(Math.abs(x));
ret += (20.0 * Math.sin(6.0 * x * this.PI) + 20.0 * Math.sin(2.0 * x * this.PI)) * 2.0 / 3.0;
ret += (20.0 * Math.sin(y * this.PI) + 40.0 * Math.sin(y / 3.0 * this.PI)) * 2.0 / 3.0;
ret += (160.0 * Math.sin(y / 12.0 * this.PI) + 320 * Math.sin(y * this.PI / 30.0)) * 2.0 / 3.0;
return ret;
},
transformLon: function (x, y) {
var ret = 300.0 + x + 2.0 * y + 0.1 * x * x + 0.1 * x * y + 0.1 * Math.sqrt(Math.abs(x));
ret += (20.0 * Math.sin(6.0 * x * this.PI) + 20.0 * Math.sin(2.0 * x * this.PI)) * 2.0 / 3.0;
ret += (20.0 * Math.sin(x * this.PI) + 40.0 * Math.sin(x / 3.0 * this.PI)) * 2.0 / 3.0;
ret += (150.0 * Math.sin(x / 12.0 * this.PI) + 300.0 * Math.sin(x / 30.0 * this.PI)) * 2.0 / 3.0;
return ret;
}
};會(huì)的,因?yàn)楦淖兞隧?yè)面的結(jié)構(gòu)
這種引用方式需要將CSSModule打開。
module.exports = {
'GET /user_new': fn_usrs_new,
'OPTIONS /user_new': fn_usrs_option,
'GET /users': fn_usrs,
'POST /users': add_usrs,
'DELETE /users/:id': del_usrs,
};
這個(gè)是路由的地址,接口的地址,我本地的服務(wù),
解決的方法就是在集中處理錯(cuò)誤的地方統(tǒng)一設(shè)置
ctx.set("Access-Control-Allow-Origin", "*");
ctx.set("Access-Control-Allow-Methods", "POST, GET, OPTIONS, DELETE");
ctx.set("Access-Control-Max-Age", "3600");
ctx.set("Access-Control-Allow-Headers", "x-requested-with,Authorization,Content-Type,Accept");
ctx.set("Access-Control-Allow-Credentials", "true");
這些東西,可以挑著用,看項(xiàng)目的需要。其次還有就是OPTIONS確實(shí)是router內(nèi)容自己處理,我們不需要處理,只需要告訴OPTIONS請(qǐng)求返回200就行,上面的函數(shù)也就變成了下面這個(gè)樣子
// 集中處理錯(cuò)誤
const handler = async (ctx, next) => {
// log request URL:
ctx.set("Access-Control-Allow-Origin", "*");
ctx.set("Access-Control-Allow-Methods", "POST, GET, OPTIONS, DELETE");
ctx.set("Access-Control-Max-Age", "3600");
ctx.set("Access-Control-Allow-Headers", "x-requested-with,Authorization,Content-Type,Accept");
ctx.set("Access-Control-Allow-Credentials", "true");
if (ctx.request.method == "OPTIONS") {
ctx.response.status = 200
}
console.log(`Process ${ctx.request.method} ${ctx.request.url}`);
try {
await next();
console.log('handler通過(guò)')
} catch (err) {
console.log('handler處理錯(cuò)誤')
ctx.response.status = err.statusCode || err.status || 500;
ctx.response.body = {
message: err.message
};
}
};可以.參數(shù)可以傳遞. 參數(shù)可以是任意類型.
那么你的這個(gè)width是字符串啊.傳遞參數(shù)時(shí)還不是css呢.親.
canvas元素是置換元素,需要設(shè)置其width和height屬性。<canvas id = "canvas" width="200" height="300"></canvas>必須設(shè)置其width 和height屬性,設(shè)置css的width 和height就會(huì)出現(xiàn)像素模糊。想知道具體原因,可以百度。
用了什么打包工具呢,可能配置的不對(duì)
一次for循環(huán)結(jié)束,常量b的生命周期就結(jié)束了,下一次for循環(huán)的時(shí)候,又new了一個(gè)新的常量b
<Route path="goods" component={Goods} />
<Route path="goods/:id" component={Goods} />
兩個(gè)路由對(duì)應(yīng)的component是一樣的啊,所以路由變了頁(yè)面內(nèi)容一樣
https://zhuanlan.zhihu.com/p/...
想辦法workaround吧
ES7環(huán)境
b = a.reduce((origin, next) => origin.concat(next), []).reduce((origin, next) => {
let index = origin.findIndex(item => item.some(element => element.id === next.id));
index >= 0 ? origin[index].push(next) : origin.push([next]);
return origin;
}, []);
Lodash
let b = _.flatten(a).reduce((origin, next) => {
let index = _.findIndex(origin, item => item.some(element => element.id === next.id));
index >= 0 ? origin[index].push(next) : origin.push([next]);
return origin;
}, []);jinja可以不用學(xué)了,但是路由還是要學(xué)的,因?yàn)橐粋€(gè)后臺(tái)服務(wù)一般不會(huì)只提供一個(gè)API,并且REST API的一些參數(shù)也是放在URL里的,例如請(qǐng)求一個(gè)地區(qū)的天氣,API如https://www.example.com/api/weather/{city},后面的city隨便填比如https://www.example.com/api/weather/shanghai,在Flask里就要定義這樣的路由
@app.route('/api/weather/{city}')
def weather(city):
pass
這樣的設(shè)置也比用'https://www.example.com/api/w...',通過(guò)參數(shù)請(qǐng)求,然后在程序里用request.arg.get('city')要方便,
所以路由還是要學(xué)一下的
xlsx可以被unzip,如圖可見
所以問(wèn)題就比較簡(jiǎn)單unzip your.xlsx (隨便找個(gè)zip的包 用內(nèi)置的zlib即可)
然后find all images in /xl/media (內(nèi)置fs模塊)
參考資料更容易找了 你谷歌一下nodejs get image from excel
第一條就是。所以,要善用搜索引擎
Bootstrap 引用出錯(cuò)。
先去了解下socket的原理再說(shuō),socket客戶端和服務(wù)端是怎么交互的
北大青鳥APTECH成立于1999年。依托北京大學(xué)優(yōu)質(zhì)雄厚的教育資源和背景,秉承“教育改變生活”的發(fā)展理念,致力于培養(yǎng)中國(guó)IT技能型緊缺人才,是大數(shù)據(jù)專業(yè)的國(guó)家
達(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
北大課工場(chǎng)是北京大學(xué)校辦產(chǎn)業(yè)為響應(yīng)國(guó)家深化產(chǎn)教融合/校企合作的政策,積極推進(jìn)“中國(guó)制造2025”,實(shí)現(xiàn)中華民族偉大復(fù)興的升級(jí)產(chǎn)業(yè)鏈。利用北京大學(xué)優(yōu)質(zhì)教育資源及背
博為峰,中國(guó)職業(yè)人才培訓(xùn)領(lǐng)域的先行者
曾工作于聯(lián)想擔(dān)任系統(tǒng)開發(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ū)ο箝_發(fā)經(jīng)驗(yàn),技術(shù)功底深厚。 授課風(fēng)格 授課風(fēng)格清新自然、條理清晰、主次分明、重點(diǎn)難點(diǎn)突出、引人入勝。
精通HTML5和CSS3;Javascript及主流js庫(kù),具有快速界面開發(fā)的能力,對(duì)瀏覽器兼容性、前端性能優(yōu)化等有深入理解。精通網(wǎng)頁(yè)制作和網(wǎng)頁(yè)游戲開發(fā)。
具有10 年的Java 企業(yè)應(yīng)用開發(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)師。