Closed YuMao233 closed 1 year ago
I followed the tutorial to write a simple editor (https://codesandbox.io/s/vue-3-support-for-vue-prism-editor-fm7v5?file=/src/App.vue),
When browsing more than 300 lines of Javascript code, there will be obvious performance problems and slow typing.
I try to use the throttle design, there is a significant improvement. But will affect the user experience.
highlighter(code) { clearTimeout(this.highlighterThrottle); this.highlighterThrottle = setTimeout(() => (this.highlighterThrottleb = false), 100); if (!this.highlighterThrottleb) { this.highlighterThrottleb = true; return highlight(code, languages.js); } else { return code; } }
Is there any way to improve this problem?
I followed the tutorial to write a simple editor (https://codesandbox.io/s/vue-3-support-for-vue-prism-editor-fm7v5?file=/src/App.vue),
When browsing more than 300 lines of Javascript code, there will be obvious performance problems and slow typing.
I try to use the throttle design, there is a significant improvement. But will affect the user experience.
Is there any way to improve this problem?