Skip to content

Commit 5439995

Browse files
authored
Fix the alreadyHighlighted issue
1 parent 4a6894b commit 5439995

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

npm-package/CodeEditor.vue

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,13 +216,15 @@ export default {
216216
highlight: {
217217
mounted(el, binding) {
218218
el.textContent = binding.value;
219+
el.removeAttribute('data-highlighted');
219220
hljs.highlightElement(el);
220221
},
221222
updated(el, binding) {
222223
if (el.scrolling) {
223224
el.scrolling = false;
224225
} else {
225226
el.textContent = binding.value;
227+
el.removeAttribute('data-highlighted');
226228
hljs.highlightElement(el);
227229
}
228230
},

0 commit comments

Comments
 (0)