如果你每次執(zhí)行app()互相沒有聯(lián)系 可以放在一個(gè)數(shù)組里 用Promise.all來執(zhí)行
let p =[]
for(let i=0;i<data.length;i++){
p.push(app(i,data))
}
Promise.all(p).then(res=>{
console.log(res)
})
有源碼嗎?貼出來看看
具體邏輯沒看,但if($(".icon-one"))
這種寫法肯定是不對(duì)的,因?yàn)?code>$(".icon-one")返回的是個(gè)jQ對(duì)象,自動(dòng)轉(zhuǎn)換為true
,這樣上邊的分支實(shí)際就變成常通了。
這種一般是要在事件回調(diào)中用到$(this)
,這個(gè)是jQ對(duì)e.target
的一個(gè)封裝(相當(dāng)于$(e.target)
),它返回的是jQ封裝的事件被觸發(fā)的那個(gè)DOM對(duì)象,而判斷是否包含一個(gè)類,則可以用.is()
這個(gè)API。簡(jiǎn)而言之,寫成if ( $(this).children().is(".icon-one") )
吧。
這樣就已經(jīng)傳進(jìn)去了,關(guān)鍵是你怎么取的問題
aId = this.props.history.params.aId
隨便找個(gè)瀏覽器,調(diào)試一下document.getElementsByTagName('span'),里面有個(gè)style屬性,自己看
微信不推薦在瀏覽器端獲取access_token,會(huì)帶來以下問題:
Calling the next() method with an argument will resume the generator function execution, replacing the yield expression where execution was paused with the argument from next().
from: https://developer.mozilla.org...
就是說,如果你調(diào)用next方法時(shí)附帶了參數(shù)的話,generator會(huì)繼續(xù)執(zhí)行,直到下一個(gè)yield時(shí)停止,這是會(huì)把yield表達(dá)式換成傳入的參數(shù)。
H5 只會(huì)提供坐標(biāo)值給你,如果想要獲取精確的省市區(qū)位置,可以使用百度、高德的 api 去獲取。注意瀏覽器權(quán)限,原生的 geolocation 是無法在 http 下生效的,只能在 https 有效果。
上面的你們?cè)搶弻忣}了,題主是在vue中使用 JSX 語法,他的綁定方法是對(duì)的。https://cn.vuejs.org/v2/guide...
應(yīng)該是onMousedown,而不是onMouseDown,不存在mouseDown這個(gè)事件。
1
//var VueRouter = require ('vue-router')
import Router from 'vue-router'
//Vue.use (VueRouter)
Vue.use(Router)
是否use
2 這個(gè)this.指向什么 倆個(gè)方向排查
function getInfo(page) {
$.ajax({
type: 'post',
url: '/web/illegalMessages',
//dataType:'json',
data: {
'page': page
},
async: false,
success: function(data) {
//var data = JSON.parse(data);
var list = data.data;
totalRow = data.totalRow; //獲取總條數(shù)
if (data.flag == 'success') {
$('tbody').html(''); //先清空,否則再次查詢會(huì)在本頁累加數(shù)據(jù)
var _html = "";
for (var i = 0; i < list.length; i++) {
var num=i+(page-1)*10
_html += '<tr id="' + list[i].illegalmessageid + '">' +
'<td>' + num + '</td>' +
'<td>' + list[i].occurarea + '</td>' +
'<td>' + list[i].platenumber + '</td>' +
'<td>' + list[i].occurtime + '</td>' +
'<td>' + list[i].markImgPath + '</td>' +
'<td>' + list[i].detailImgPath + '</td>' +
'<td>' + list[i].voicePath + list[i].videoPath + '</td>' +
'<td>'+
'<a href="javascript:;">'+
list[i].deal +
'</a>'+
'</td>' +
'</tr>'
}
$('tbody').append(_html);
}
//配置并加載所需模塊
layui.config({
base: 'base/lay/modules/'
}).use(['laypage', 'table'], function() {
var laypage = layui.laypage;
var table = layui.table;
//實(shí)例化分頁
laypage.render({
elem: 'layPage' //分頁容器的id
,
layout: ['prev', 'page', 'next', 'limits', 'count'] //排版
,
limit: 10 //每頁顯示數(shù)
,
count: totalRow //總條數(shù)
,
curr: page //當(dāng)前頁
,
groups: 3 //連續(xù)出現(xiàn)的頁數(shù)
,
theme: '#1E9FFF' //自定義選中色值
,
skip: true //開啟跳頁
,
jump: function(obj, first) { //點(diǎn)擊頁碼跳頁
if (!first) {
$('tbody').html('');
getInfo(obj.curr); //查詢,傳參:當(dāng)前頁
}
}
});
});
},
error: function(XMLHttpRequest, textStatus, errorThrown) {
console.log(XMLHttpRequest.status);
console.log(XMLHttpRequest.readyState);
console.log(textStatus);
},
})
}
$(function() {
//存儲(chǔ)id到會(huì)話并且跳轉(zhuǎn)頁面
$('tbody a').unbind('click').on('click',function(){
var id=$(this).parents('tr').attr("id");
sessionStorage.setItem('id',id);
$(this).attr("href","../Illegal_honking/Illegal_honking.html");
})
})
H5還能怎么實(shí)現(xiàn)……要么是模擬實(shí)現(xiàn),要么你直接把這個(gè)需求懟回去。。。
/[^\w]/g
這個(gè)地方復(fù)制粘貼就行了 這個(gè)地方有很多,復(fù)制粘貼就行了
你應(yīng)該先去看看 http 協(xié)議:典型的 HTTP 會(huì)話
一次 http 會(huì)話先由客戶端(瀏覽器)發(fā)起請(qǐng)求,然后服務(wù)器收到請(qǐng)求之后,根據(jù)請(qǐng)求內(nèi)容返回客戶端想要的數(shù)據(jù),叫響應(yīng)。
一個(gè)請(qǐng)求由請(qǐng)求頭、請(qǐng)求正文等組成,url
,get/post
這些屬于請(qǐng)求頭的部分,請(qǐng)求正文就是你re.send
方法發(fā)送的數(shù)據(jù)。
服務(wù)器收到請(qǐng)求后返回的響應(yīng)同樣有響應(yīng)頭、響應(yīng)正文,例如你re.status
的值其實(shí)就是響應(yīng)頭里的 HTTP 狀態(tài)碼,re.responseText
就是響應(yīng)正文。
為什么你會(huì)收到整個(gè)http.html
頁面,這是因?yàn)榉?wù)器返回的響應(yīng)正文就是整個(gè)http.html
頁面,跟你 send 過去的東西沒有任何關(guān)系。
如果你想收到的 send 過去的東西,你需要在服務(wù)器的代碼里進(jìn)行處理,讓服務(wù)器返回你想要的響應(yīng)內(nèi)容。
let Event = new Vue();
// 監(jiān)聽
Event.$on('xxx', function (a) {});
// 觸發(fā)
Event.$emit('xxx', a);
看注釋
for (n = 0; n<8; n++){
//在頁面中創(chuàng)建canvas
var oCan = document.createElement('canvas');
$("#div1").append(oCan);
var context=oCan.getContext("2d");
oCan.innerHTML = '<img src="'+ imgSrc[n]+ '" alt=""/>'; //這里是干什么用????
//imgSrc為一個(gè)圖片src的數(shù)組。
//添加圖片
var image = new Image();
image.src = imgSrc[n];
console.log(image);
image.onload = function () {
var imgHeight = this.height;
var imgWidth = this.width;
imgWidth=oCan.width;
imgHeight=oCan.height;
context.drawImage(image, 0, 0,imgWidth,imgHeight); //你把圖片始終畫在0,0位置,所有圖片全覆蓋在一起了
var imageData =context.getImageData(0, 0, imgWidth, imgHeight);
console.log(imageData.data);
}
媒體查詢
@media only screen and (device-width: 375px) and (device-height: 812px){
// 你的樣式
}
如果寫在模塊里面,需要require
,或者import
進(jìn)來,除非掛載在window
下
App.vue組件
北大青鳥APTECH成立于1999年。依托北京大學(xué)優(yōu)質(zhì)雄厚的教育資源和背景,秉承“教育改變生活”的發(fā)展理念,致力于培養(yǎng)中國(guó)IT技能型緊缺人才,是大數(shù)據(jù)專業(yè)的國(guó)家
北大青鳥中博軟件學(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),是中國(guó)一站式人才培養(yǎng)平臺(tái)、一站式人才輸送平臺(tái)。2014年4月3日在美國(guó)成功上市,融資1
浪潮集團(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)突出、引人入勝。
曾工作于聯(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é)及管理工作。
精通HTML5和CSS3;Javascript及主流js庫(kù),具有快速界面開發(fā)的能力,對(duì)瀏覽器兼容性、前端性能優(yōu)化等有深入理解。精通網(wǎng)頁制作和網(wǎng)頁游戲開發(fā)。
具有10 年的Java 企業(yè)應(yīng)用開發(fā)經(jīng)驗(yàn)。曾經(jīng)歷任德國(guó)Software AG 技術(shù)顧問,美國(guó)Dachieve 系統(tǒng)架構(gòu)師,美國(guó)AngelEngineers Inc. 系統(tǒng)架構(gòu)師。