Move syntax highlighting into a method
Fix https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/12198#note_37142936
This commit is contained in:
parent
3a9f210b5c
commit
d59aed94e7
1 changed files with 8 additions and 2 deletions
|
@ -4,7 +4,7 @@ import Store from '../stores/repo_store';
|
|||
export default {
|
||||
data: () => Store,
|
||||
mounted() {
|
||||
$(this.$el).find('.file-content').syntaxHighlight();
|
||||
this.highlightFile();
|
||||
},
|
||||
computed: {
|
||||
html() {
|
||||
|
@ -12,10 +12,16 @@ export default {
|
|||
},
|
||||
},
|
||||
|
||||
methods: {
|
||||
highlightFile() {
|
||||
$(this.$el).find('.file-content').syntaxHighlight();
|
||||
},
|
||||
},
|
||||
|
||||
watch: {
|
||||
html() {
|
||||
this.$nextTick(() => {
|
||||
$(this.$el).find('.file-content').syntaxHighlight();
|
||||
this.highlightFile();
|
||||
});
|
||||
},
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue