html2canvas: configuration--配置

---
async :Whether to parse and render the element asynchronously
---
allowTaint :Whether to allow cross-origin images to taint the canvas
---
useCORS :Whether to attempt to load images from a server using CORS
---
canvas:Existing  canvas element to use as a base for drawing on
---
foreignObjectRendering:Whether to use ForeignObject rendering if the browser supports it
---
imageTimeout:Timeout for loading an image (in milliseconds). Set to  0 to disable timeout
---
ignoreElements:Predicate function which removes the matching elements from the render
---
logging:Enable logging for debug purposes
---
onclone:Callback function which is called when the Document has been cloned for rendering, can be used to modify the contents that will be rendered without affecting the original source document
---
proxy:Url to the proxy which is to be used for loading cross-origin images. If left empty, cross-origin images won't be loaded
---
removeContainer:Whether to cleanup the cloned DOM elements html2canvas creates temporarily
---
scale:The scale to use for rendering. Defaults to the browsers device pixel ratio
---
width:The width of the  canvas
---
x:Crop canvas x-coordinate
---
scrollX:The x-scroll position to used when rendering element, (for example if the Element uses  position: fixed )
---
windowWidth:Window width to use when rendering  Element , which may affect things like Media queries
---

async:是否異步解析和呈現(xiàn)的元素

allowTaint:是否允許跨源圖像到畫布上的污點(diǎn)

useCORS:嘗試從服務(wù)器加載圖像使用歌珥

canvas:現(xiàn)有的畫布元素使用作為借鑒的基礎(chǔ)

foreignObjectRendering:是否使用ForeignObject呈現(xiàn)如果瀏覽器支持它

imageTimeout:超時(shí)(以毫秒為單位)。設(shè)置為0以禁用超時(shí)

ignoreElements:謂詞函數(shù)刪除匹配元素的呈現(xiàn)

logging:啟用日志用于調(diào)試目的

onclone:回調(diào)函數(shù)叫做文檔時(shí)已經(jīng)克隆了渲染,可以用來(lái)修改的內(nèi)容呈現(xiàn)在不影響原來(lái)的源文檔

proxy:Url的代理用于加載跨源圖像。如果留空,則不會(huì)加載跨源圖像

removeContainer:是否清理克隆的DOM元素暫時(shí)html2canvas創(chuàng)建

scale:用于規(guī)模呈現(xiàn)。默認(rèn)為瀏覽器設(shè)備像素比

width:畫布的寬度

x:作物畫布坐標(biāo)

scrollX:x-scroll位置時(shí)使用渲染元素(例如如果元素使用位置:固定)

windowWidth:窗口寬度渲染元素時(shí)使用,可能會(huì)影響諸如媒體查詢
最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

友情鏈接更多精彩內(nèi)容