surmon-china / vue-codemirror

@codemirror code editor component for @vuejs
https://github.surmon.me/vue-codemirror
MIT License
3.28k stars 382 forks source link

行数与代码的样式重叠 #68

Open qushe opened 6 years ago

qushe commented 6 years ago

引用github demo:https://github.com/surmon-china/vue-codemirror/blob/master/examples/02-text-javascript.vue

default

surmon-china commented 6 years ago

遇到过,忘了怎么解决的了,总之能解决,等以后遇到了,我再来回复

chentvtchen commented 6 years ago

我也遇到了这个问题。我跳转到一个新的路由,然后再通过路由跳转到这个页面,就会样式重叠,setSize不起作用 image 页面 刷新一下才能解决

surmon-china commented 5 years ago

@chentvtchen 用 v-if 实现一个更新器吧

chentvtchen commented 5 years ago

@surmon-china 请问怎么实现呀,能告诉我大致方法么

surmon-china commented 5 years ago

@chentvtchen 类似如此。

<codemirror v-if="renderCm" />
mountd() {
   this.$nextTick(() => {
     this.renderCm = true
  })
}
chentvtchen commented 5 years ago

@surmon-china 当时用了更新器不行,我就把样式给改了,设置行高和段前距离

liuyib commented 1 year ago

挂载或设置了默认值后,手动刷新下 editor.refresh(),因为官方的 autoRefresh 参数有时会失效

我在 React 项目里遇到的,供你们参考