设置富文本编辑器mavon-editor高度为内容的100%

mavon-editor总有一个固定的高度,但是当我输入内容比较少时,是有些占地方的。所以需要mavon-editor随着内容自动变化高度
代码设置如下:

  <mavon-editor
      v-model="release.content"
      class="content-show"
      :subfield="false"
      :default-open="'preview'"
      :editable="false"
      :toolbars-flag="false"
    />

.content-show {
  height: 100%!important;
}

::v-deep .v-note-wrapper {
    min-height: 60px;
}

注意,要给v-note-wrapper设置一个min-height,这样mavon-editor的100%才能生效

猜你喜欢

转载自blog.csdn.net/changyana/article/details/132381521