mounted() {
// 获取 CodeMirror 实例
const cm = this.$refs.editor.editor;
// 获取根节点
const root = this.$refs.editor.$el;
// 找到所有 CodeMirror cm-s-idea 元素
const elements = root.querySelectorAll('.CodeMirror.cm-s-idea');
// 遍历元素,设置高度为 800px
elements.forEach(elem => {
elem.style.height = this.height;
})}```
vue中解决b-code-editor没法调整高度的问题
最新推荐文章于 2024-06-01 17:34:39 发布