猛跑小豬
2021-09-17 21:02:08
我想知道如何在這樣的 javascript 中為一組值創(chuàng)建鍵?const array = ["NodeJs", "Javascript", "React"]并像這樣轉(zhuǎn)換它c(diǎn)onst array = [{"name": "NodeJs"}, {"name": "Javascript"}, {"name": "React"}]
8 回答


BIG陽
TA貢獻(xiàn)1859條經(jīng)驗 獲得超6個贊
你必須給z-indexLoading Spinner 一個比 Modal更大的z-index.
讓我們試試這個:
#loadingoverlay {
position: fixed;
top: 0;
z-index: 9999;
width: 100%;
height: 100%;
display: none;
background: rgba(0,0,0,0.6);
}

喵喵時光機(jī)
TA貢獻(xiàn)1846條經(jīng)驗 獲得超7個贊
您也可以使用Array.from(iterable, mappingFunction)它來返回一個包含對象的新數(shù)組{name: name}:
const array = ["NodeJs", "Javascript", "React"];
const mapArray = Array.from(array, (name) => ({name}));
console.log(mapArray);
添加回答
舉報
0/150
提交
取消