第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問(wèn)題,去搜搜看,總會(huì)有你想問(wèn)的

無(wú)法將參數(shù)傳遞給評(píng)估函數(shù)

無(wú)法將參數(shù)傳遞給評(píng)估函數(shù)

千萬(wàn)里不及你 2022-10-27 14:48:38
我正在嘗試將背景顏色作為參數(shù)傳遞給函數(shù),如下面的代碼所示:const loc = await page.waitForSelector("#Login");const style = 'background-color';const thecssStyle = await page.evaluate(el =>  window.getComputedStyle(el).getPropertyValue(style),loc);console.log("Print :"+thecssStyle);這不起作用,我收到以下錯(cuò)誤:UnhandledPromiseRejectionWarning:錯(cuò)誤:評(píng)估失?。篟eferenceError:未定義樣式但是,如果我直接傳遞背景顏色,如下所示,它絕對(duì)可以正常工作:const loc = await page.waitForSelector("#Login");const thecssStyle = await page.evaluate(el =>  window.getComputedStyle(el).getPropertyValue('background-color'),loc);console.log("Print :"+thecssStyle);我想將背景顏色作為參數(shù)傳遞,而不是直接傳遞它我該怎么做?
查看完整描述

1 回答

?
收到一只叮咚

TA貢獻(xiàn)1821條經(jīng)驗(yàn) 獲得超5個(gè)贊

你應(yīng)該style以同樣的方式通過(guò)loc


const loc = await page.waitForSelector("#Login");

const style = 'background-color';

const thecssStyle = await page.evaluate(

  (el, style) => window.getComputedStyle(el).getPropertyValue(style),

  loc,

  style

);

console.log("Print :"+thecssStyle);


查看完整回答
反對(duì) 回復(fù) 2022-10-27
  • 1 回答
  • 0 關(guān)注
  • 116 瀏覽
慕課專(zhuān)欄
更多

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢(xún)優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)