umi在打包时如何根据项目名去自动生成config的相应配置(目前是打包完手动更改)?
umi在打包时如何项目名去自动生成config的相应配置,多个项目用一个分支代码的时候,config里重要配置项是不一样的
顺晟科技
2022-09-15 21:57:11
83
//两个参数:所需要截图的元素id,截图后要执行的函数, canvas为截图后返回的最后一个canvas html2canvas(document.getElementById(\'id\')).then(function(canvas) {document.body.appendChild(canvas);});
参数名称 | 类型 | 默认值 | 描述 | allowTaint boolean false Whether to allow cross-origin images to taint the canvas---允许跨域 background string #fff Canvas background color, if none is specified in DOM. Set undefined for transparent---canvas的背景颜色,如果没有设定默认透明 height number null Define the heigt of the canvas in pixels. If null, renders with full height of the window.---canvas高度设定 letterRendering boolean false Whether to render each letter seperately. Necessary if letter-spacing is used.---在设置了字间距的时候有用 logging boolean false Whether to log events in the console.---在console.log()中输出信息 proxy string undefined Url to the proxy which is to be used for loading cross-origin images. If left empty, cross-origin images won\'t be loaded.---代理地址 taintTest boolean true Whether to test each image if it taints the canvas before drawing them---是否在渲染前测试图片 timeout number 0 Timeout for loading images, in milliseconds. Setting it to 0 will result in no timeout.---图片加载延迟,默认延迟为0,单位毫秒 width number null Define the width of the canvas in pixels. If null, renders with full width of the window.---canvas宽度 useCORS boolean false Whether to attempt to load cross-origin images as CORS served, before reverting back to proxy--这个我也不知道是干嘛的
---|
html2canvas(document.getElementById(\'htmlDom\'), { useCORS:true,//设置该属性,图片请求头带Access-Control-Allow-Origin: * 的可以生成,图片请求如有带301跳转,则无法生成 onrendered: function(canvas) { window.can = canvas; console.log(canvas); $("#tarPic").attr("src",canvas.toDataURL()) document.body.appendChild(canvas); }, // width: 300, // height: 300 });
示例代码:https://files.cnblogs.com/files/zhidong123/htmlToCanvas.rar
https://github.com/zhidong10/solutions/tree/master/htmlToCanvas
16
2022-10
15
2022-09
15
2022-09
15
2022-09
15
2022-09
15
2022-09