fix: missing code highlighting when toggling markdown preview (#1484)
This commit is contained in:
parent
88f707b7c1
commit
bf9c6dda1c
@ -347,6 +347,16 @@ export default {
|
||||
mode: get('editor/mode'),
|
||||
activeModal: sync('editor/activeModal')
|
||||
},
|
||||
watch: {
|
||||
previewShown (newValue, oldValue) {
|
||||
if (newValue && !oldValue) {
|
||||
this.$nextTick(() => {
|
||||
Prism.highlightAllUnder(this.$refs.editorPreview)
|
||||
Array.from(this.$refs.editorPreview.querySelectorAll('pre.line-numbers')).forEach(pre => pre.classList.add('prismjs'))
|
||||
})
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
toggleModal(key) {
|
||||
this.activeModal = (this.activeModal === key) ? '' : key
|
||||
|
Loading…
Reference in New Issue
Block a user