在线观看不卡亚洲电影_亚洲妓女99综合网_91青青青亚洲娱乐在线观看_日韩无码高清综合久久

鍍金池/ 問答/ HTML問答
枕邊人 回答

為什么非得用map,寫個for循環(huán)就行了。

墨沫 回答

不是還有個 errorMessage 嗎,errorMessage 為空就是驗證成功了

維她命 回答

地址是ok的?看看network加載這段資源是否ok的

笨小蛋 回答

forEach不適合接收這種回調(diào)函數(shù)。
async函數(shù)返回的是Promise,所以你可以用map得到一個Promise的數(shù)組。 你可以promises= paramArr.map(async (val, i) => ...。
然后使用await Promise.all(promises)


我再看了下你的代碼,data.push({ 'a': result[item].a, 'b': result[item].b });在這里的順序是不確定的,這樣的話data的順序就會有問題了,你或者可以使用for循環(huán)放棄并發(fā)請求,或者可以最后對data進行排序獲得和原來一樣的順序(每次push的時候同時存入索引i,用來排序)。


當然如果data.push不立即處理,而是讓Promise返回結果,那么Promise.all就是有序的,然后再存放到data里。

愿如初 回答

Unicode 和 UTF-8 之間的轉(zhuǎn)換關系表 ( x 字符表示碼點占據(jù)的位 )

碼點的位數(shù)    碼點起值    碼點終值    字節(jié)序列    Byte 1    Byte 2    Byte 3    Byte 4    Byte 5    Byte 6
  7    U+0000    U+007F    1    0xxxxxxx
11    U+0080    U+07FF    2    110xxxxx    10xxxxxx
16    U+0800    U+FFFF    3    1110xxxx    10xxxxxx    10xxxxxx
21    U+10000    U+1FFFFF    4    11110xxx    10xxxxxx    10xxxxxx    10xxxxxx
26    U+200000    U+3FFFFFF    5    111110xx    10xxxxxx    10xxxxxx    10xxxxxx    10xxxxxx
31    U+4000000    U+7FFFFFFF    6    1111110x    10xxxxxx    10xxxxxx    10xxxxxx    10xxxxxx    10xxxxxx

非3個字節(jié)就是0x0800-0xffff之外的

const str = '1。中\(zhòng)文a';
const reg = /[^\u0800-\uffff]/g;
str.replace(reg,'');
骨殘心 回答

你是要表單也顯示2018-05-11T16:00:00:00 你應該把表格時間格式變一下顯示成2018-5-12

憶往昔 回答

JSON.parse('{json數(shù)據(jù)}') 這樣就轉(zhuǎn)為object了

使勁操 回答

一定要確認你們新建的服務有沒有打開,在server文件夾下面,node index,開啟服務器。

忘了我 回答
:disabled="yourVar"

yourVar可以是datacomputedprops中的變量

背叛者 回答

不行的,是需要服務,你隨便本地起個服務不就行了,方法很多

安若晴 回答

應該是你對數(shù)據(jù)修改后導致了整個數(shù)組UI的重繪。
vue2中有對應的解決方案vue文檔
簡單來說,v-for循環(huán)時,每個綁定一個不相同的key值,數(shù)據(jù)發(fā)生變化時,就會只重繪對應key的UI,減少性能損耗,也就不會出現(xiàn)lz的閃一下的問題。
如果對于這個地方還有什么疑惑,可以看一下這個鏈接,做實驗有助于理解。

厭惡我 回答

es6的object.values方法,直接轉(zhuǎn)換成數(shù)組

祉小皓 回答

參數(shù)有()還是用.key, 作死。。。。

心悲涼 回答

優(yōu)化點:

  1. 組件使用Array.map方法優(yōu)化,
  2. componentReciveProps 這個不需要
  3. 在render中減少計算,使用react 計算屬性寫法

比如:

if(this.state.safety.length !== 0) {
            this.state.safety.map(function (item) {
                safetyData[item['name']] = item['value']
            })
        }

可更改為

get computedSafetyDate() {
    ...
    }
  1. 減少組件無謂的更新判斷
  2. 減少組件內(nèi)部使用bind, 箭頭函數(shù)(因為這些在js中會重新重建一個函數(shù),降低性能)

暫時就這么多了

誮惜顏 回答

監(jiān)聽在前,觸發(fā)在后;然而你卻正好相反

陪妳哭 回答

GPlan.addPlan 最后一個參數(shù) true

壞脾滊 回答

樓上有點小問題, 我在他的基礎上改了改

function outerFn (param){
    var result = {}
    function fn(obj, prefix) {
        for (key in obj) {
            let fullKey = prefix ? (prefix + '.' + key) : key;
            if (typeof obj[key] === 'object') {
                fn(obj[key], fullKey)
            } else {
                result[fullKey] = obj[key]
            }
        }
    }
    fn(param);
    return result;
}
單眼皮 回答
修改答案,使用jquery遍歷tr
js的.addEventListener事件在jquery是.on這個。

getElementById("t").addEventListener("mouseover", function()
改成
$("#t tr").on("mouseover",function()

<script type="text/javascript">
$("#t").find("tr").each(function(){//遍歷tr
$("#t tr").mouseover(function(){//mouseover事件
var index = $("#t tr").index(this);
console.log("第"+ index +"個tr");
});
});
</script>

圖片描述

參考代碼。效果截圖
<script type="text/javascript">
document.getElementById("t").addEventListener("mouseover", function(){
        if(this.getElementsByTagName("td")){
        console.log("1")
    };
            if(this.getElementsByTagName("tr")){
        console.log("2")
    };
                if(this.getElementsByTagName("table")){
        console.log("3")
    };
//    if (e.target.nodeName.toLowerCase() == "td") {
//        console.log("1");
//    };
//    if (e.target.nodeName.toLowerCase() == "tr") {
//        console.log("2");
//    };
//    if (e.target.nodeName.toLowerCase() == "table") {
//        console.log("3");
//    }
}, false)
</script>

圖片描述