fix:pick editor lib mode style
This commit is contained in:
@@ -112,6 +112,7 @@ export class Draw {
|
|||||||
this.elementList = elementList
|
this.elementList = elementList
|
||||||
this.listener = listener
|
this.listener = listener
|
||||||
|
|
||||||
|
this._formatContainer()
|
||||||
this.pageContainer = this._createPageContainer()
|
this.pageContainer = this._createPageContainer()
|
||||||
this._createPage(0)
|
this._createPage(0)
|
||||||
|
|
||||||
@@ -511,9 +512,13 @@ export class Draw {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private _createPageContainer(): HTMLDivElement {
|
private _formatContainer() {
|
||||||
// 容器宽度需跟随纸张宽度
|
// 容器宽度需跟随纸张宽度
|
||||||
|
this.container.style.position = 'relative'
|
||||||
this.container.style.width = `${this.getWidth()}px`
|
this.container.style.width = `${this.getWidth()}px`
|
||||||
|
}
|
||||||
|
|
||||||
|
private _createPageContainer(): HTMLDivElement {
|
||||||
const pageContainer = document.createElement('div')
|
const pageContainer = document.createElement('div')
|
||||||
pageContainer.classList.add('page-container')
|
pageContainer.classList.add('page-container')
|
||||||
this.container.append(pageContainer)
|
this.container.append(pageContainer)
|
||||||
@@ -526,6 +531,8 @@ export class Draw {
|
|||||||
const canvas = document.createElement('canvas')
|
const canvas = document.createElement('canvas')
|
||||||
canvas.style.width = `${width}px`
|
canvas.style.width = `${width}px`
|
||||||
canvas.style.height = `${height}px`
|
canvas.style.height = `${height}px`
|
||||||
|
canvas.style.display = 'block'
|
||||||
|
canvas.style.backgroundColor = '#ffffff'
|
||||||
canvas.style.marginBottom = `${this.getPageGap()}px`
|
canvas.style.marginBottom = `${this.getPageGap()}px`
|
||||||
canvas.setAttribute('data-index', String(pageNo))
|
canvas.setAttribute('data-index', String(pageNo))
|
||||||
this.pageContainer.append(canvas)
|
this.pageContainer.append(canvas)
|
||||||
|
|||||||
@@ -607,7 +607,6 @@ ul {
|
|||||||
|
|
||||||
.editor {
|
.editor {
|
||||||
margin: 80px auto;
|
margin: 80px auto;
|
||||||
position: relative;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.page-container {
|
.page-container {
|
||||||
@@ -615,8 +614,6 @@ ul {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.page-container canvas {
|
.page-container canvas {
|
||||||
display: block;
|
|
||||||
background-color: #ffffff;
|
|
||||||
box-shadow: rgb(158 161 165 / 40%) 0px 2px 12px 0px;
|
box-shadow: rgb(158 161 165 / 40%) 0px 2px 12px 0px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user