We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6de47e3 commit d162fdeCopy full SHA for d162fde
dist/vue-code-highlight.min.js
@@ -788,9 +788,11 @@ var vueCodeHighlight = (function (exports) {
788
},
789
790
beforeUpdate: function beforeUpdate() {
791
- var newText = this.$slots.default[0].text.replace(/^[\r\n\s]*|[\r\n\s]*$/g, '');
792
- this.$el.querySelector('code').textContent = newText;
793
- Prism.highlightAllUnder(this.$refs.codeBlock);
+ if(this.$slots.default[0].text){
+ var newText = this.$slots.default[0].text.replace(/^[\r\n\s]*|[\r\n\s]*$/g, '');
+ this.$el.querySelector('code').textContent = newText;
794
+ Prism.highlightAllUnder(this.$refs.codeBlock);
795
+ }
796
797
};
798
0 commit comments