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

鍍金池/ 問(wèn)答
咕嚕嚕 回答
let a=['1如何','將2數(shù)2組','插值5到','另一個(gè)3數(shù)組','另一數(shù)組'];
let b=['a','b','c','d'];

let c = a.map(item => {
    let arr = item.match(/\d/), num;
    if(arr){
        num = arr[0];
    }
    if(item.indexOf(num) !== -1 && b[num -1]){
        return item.replace(new RegExp(num, 'g'), b[num -1]);
    }else{
        return item;
    }
});

<!DOCTYPE html>
<html>
<head>

<title></title>

</head>
<body>

    <table>
    <tr class="price">
        <td value="1">i</td>
        <td value="2"></td>
        <td value="3"></td>
    </tr>
    <tr class="price">
        <td value="4"></td>
        <td value="5"></td>
        <td value="6"></td>
    </tr>
    </table>
<script >
    let tds = document.querySelectorAll("td");
    tds.forEach((td)=>{    //相當(dāng)于forEach(function(td){})
        console.log(td.getAttribute('value'));
    })
</script>

</body>
</html>

糖果果 回答

頁(yè)面刷新后瀏覽器會(huì)自動(dòng)滾動(dòng)到之前的位置

檢查代碼,看看是哪個(gè)數(shù)組使用有問(wèn)題,比如一直在push但沒(méi)有清空之前的數(shù)據(jù)這種。

夏木 回答

chdir() changes the current working directory of the calling process to the directory specified in path.

man手冊(cè)中說(shuō)的很清楚了,chdir改變的是調(diào)用進(jìn)程的當(dāng)前工作目錄,而不是你終端的工作目錄。

你的瞳 回答

就是一個(gè)簡(jiǎn)單的關(guān)聯(lián)數(shù)組,相當(dāng)于Java的map,Python的dict,
可以當(dāng)字典理解,按key取值,當(dāng)然也有長(zhǎng)度。

尕筱澄 回答

不用箭頭函數(shù)就行了唄 要不就new Array(10).fill(0).map(_ => console.log(this).bind([])

孤星 回答
function rebuild (arr, key) {
  let res = []
  let keycopy = JSON.parse(JSON.stringify(key))
  let k = keycopy.shift()
  while (arr.length) {
    let obj = {}
    obj[k] = arr[0][k]
    let arrcopy = JSON.parse(JSON.stringify(arr))
    obj.children = arrcopy.filter(val => val[k] === obj[k]).map(val => {
      delete val[k]
      return val
    })
    res.push(obj)
    arr = arr.filter(val => val[k] !== obj[k])
  }
  return res.map(val => keycopy.length ? {
    ...val,
    children: rebuild(val.children, keycopy)
  } : val)
}
rebuild(_arr,['aId','bId'])
孤慣 回答
change事件觸發(fā) 把file對(duì)象添加到一個(gè)數(shù)組 然后最后上傳 上傳你的數(shù)組就好了(不一定數(shù)組 看你的數(shù)據(jù)格式定義)
尕筱澄 回答

你這樣循環(huán)不對(duì)啊,按照你的意思

判斷major_id等于id的時(shí)候就使activeName字段為true

你這樣循環(huán)如果倒數(shù)第二個(gè)數(shù)是匹配,設(shè)成true了,倒數(shù)第一個(gè)不匹配,那不就又是false了嗎?
你可以改成for循環(huán)

for(let i = 0; i < _this.listWish.length; i ++){
    for(let j = 0; i < _this.major.length; j ++){
        if (item.major_id == a.id) {
            _this.$set(a, 'activeName', true);
            _this.$set(a, 'wishId', item.wish_id);
            break;
        } else {
            _this.$set(a, 'activeName', false);
        }
    }
}
情已空 回答

js可能如下處理:

const array = [1, 2, 4, 5, 6, 7, 8, 9, 3, 10];

const arrayMoveTo = (arr, start, end) => {
  if(start > arr.length || end > arr.length || start < 1 || end < 1) {
    throw new Error('');
  }
  const temp = arr.splice(start - 1, 1)[0];
  arr.splice(end - 1, 0, temp);
  return arr;
};

console.log(arrayMoveTo(array, 9, 3));
//[ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ]
墨沫 回答

異步請(qǐng)求到的值在 Management created 之后拿到, 所以才會(huì)表現(xiàn)為你說(shuō)的那樣 console 輸出 0

爛人 回答

你controller方法里應(yīng)該下面這個(gè)賦值語(yǔ)句是吧?

@products = Product.all

可以改成

@products = Product.order(:id)

讓product按照『id』排個(gè)序就行。

汐顏 回答

將你想要復(fù)用的部分單獨(dú)封裝在一個(gè)vue文件里面,通過(guò)props或者vuex來(lái)進(jìn)行state控制。
組件化開(kāi)發(fā)是現(xiàn)在前端非常重要的思想,建議學(xué)習(xí)。

不舍棄 回答

2臺(tái);gitlab 對(duì)內(nèi)存有4g的要求,但裝上后對(duì)內(nèi)存吃的并不多,基本安裝上后可以在裝Jenkins,svn,bug。另外一臺(tái)方放Web和MySQL,再調(diào)優(yōu)一下配置基本夠用,8G內(nèi)存是個(gè)比較適中的選擇,極端一點(diǎn)可以選個(gè)16g的,cpu2cores保底。

冷溫柔 回答

函數(shù)也是對(duì)象,對(duì)象是引用數(shù)據(jù)類(lèi)型,在賦值的時(shí)候傳遞的是引用值,相當(dāng)于地址。

 var res=fn;//把函數(shù)的引用指向res 變量
  
  //提問(wèn)中 
  var res = fn(ary)//  fn(ary) 相當(dāng)一個(gè)表達(dá)式,求出結(jié)果后賦給 res
  //所以 res 指向的應(yīng)該是 return 語(yǔ)句返回的 數(shù)組ary的引用
陌顏 回答

很明顯后臺(tái)處理錯(cuò)誤啊,沒(méi)有對(duì)應(yīng)于OPTIONS請(qǐng)求的處理函數(shù)。對(duì)于跨域問(wèn)題,OPTIONS請(qǐng)求在設(shè)置了Response Header之后直接返回200就好了。

不討囍 回答

是不是你數(shù)據(jù)的id字段中有重復(fù)的,或者根本id這個(gè)字段