修改tinymce的样式
This commit is contained in:
parent
3ee72825bd
commit
7dc7aaa0be
@ -197,6 +197,7 @@ export default class extends Vue {
|
||||
|
||||
private dataRange: Date[] = []
|
||||
private initContent = ''
|
||||
private cssChanged = false
|
||||
|
||||
get lang() {
|
||||
return AppModule.language
|
||||
@ -344,7 +345,13 @@ export default class extends Vue {
|
||||
const ctx = canvas.getContext('2d') as CanvasRenderingContext2D
|
||||
ctx.clearRect(0, 0, canvas.width, canvas.height)
|
||||
var iframedoc = iframe.contentDocument || (iframe.contentWindow?.document as Document)
|
||||
iframedoc.body.style.margin = '0px'
|
||||
if (!this.cssChanged) {
|
||||
iframedoc.body.style.margin = '0px'
|
||||
var style = iframedoc.createElement('style')
|
||||
style.innerHTML = 'body p { margin-block-start:0;margin-block-end:0; }'
|
||||
iframedoc.head.appendChild(style)
|
||||
this.cssChanged = true
|
||||
}
|
||||
html2canvas(iframedoc.body, {
|
||||
canvas,
|
||||
useCORS: true,
|
||||
|
Loading…
x
Reference in New Issue
Block a user