update
This commit is contained in:
parent
d3103d5f7b
commit
31ad08e125
@ -1,3 +1,4 @@
|
|||||||
|
### 代码
|
||||||
```
|
```
|
||||||
var canvas2 = document.createElement("canvas");
|
var canvas2 = document.createElement("canvas");
|
||||||
var _canvas = document.getElementById('app');
|
var _canvas = document.getElementById('app');
|
||||||
@ -20,7 +21,7 @@ console.log(canvas2.style.width)
|
|||||||
background: null,
|
background: null,
|
||||||
windowWidth:document.body.scrollWidth,
|
windowWidth:document.body.scrollWidth,
|
||||||
windowHeight:document.body.scrollHeight,
|
windowHeight:document.body.scrollHeight,
|
||||||
x:(document.body.scrollWidth - width) / 2,
|
x:0,
|
||||||
y:0
|
y:0
|
||||||
}).then(canvas => {
|
}).then(canvas => {
|
||||||
let imgUrl = `<img style="width:100%" src="${canvas.toDataURL()}" />`
|
let imgUrl = `<img style="width:100%" src="${canvas.toDataURL()}" />`
|
||||||
@ -31,4 +32,5 @@ console.log(canvas2.style.width)
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
```
|
```
|
||||||
|
html2canvas
|
Loading…
Reference in New Issue
Block a user