提交 f0ca1735 编写于 作者: A anson 提交者: 花裤衩

perf[Tinymce]: add width prop (#1951)

上级 d8dbf92b
......@@ -40,14 +40,14 @@ export default {
mounted() {
this.height = this.$el.getBoundingClientRect().height
window.addEventListener('scroll', this.handleScroll)
window.addEventListener('resize', this.handleReize)
window.addEventListener('resize', this.handleResize)
},
activated() {
this.handleScroll()
},
destroyed() {
window.removeEventListener('scroll', this.handleScroll)
window.removeEventListener('resize', this.handleReize)
window.removeEventListener('resize', this.handleResize)
},
methods: {
sticky() {
......@@ -81,7 +81,7 @@ export default {
}
this.handleReset()
},
handleReize() {
handleResize() {
if (this.isSticky) {
this.width = this.$el.getBoundingClientRect().width + 'px'
}
......
......@@ -38,9 +38,14 @@ export default {
default: 'file edit insert view format table'
},
height: {
type: Number,
type: [Number, String],
required: false,
default: 360
},
width: {
type: [Number, String],
required: false,
default: 'auto'
}
},
data() {
......@@ -91,6 +96,7 @@ export default {
language: this.language,
selector: `#${this.tinymceId}`,
height: this.height,
width: this.width,
body_class: 'panel-body ',
object_resizing: false,
toolbar: this.toolbar.length > 0 ? this.toolbar : toolbar,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册