mavonEditor icon indicating copy to clipboard operation
mavonEditor copied to clipboard

[Bug] markdownIt的this指向问题

Open jinwei1116 opened this issue 1 year ago • 2 comments

🐛 Bug Report

https://github.com/hinesboy/mavonEditor/blob/master/src/lib/mixins/markdown.js 这个文件中代码有问题 $_render(src, func, res) { var $vm = this; var deal = 0; for (var i = 0; i < needLangs.length; i++) { var url = $vm.p_external_link.hljs_lang(needLangs[i]); loadScript(url, function () { deal = deal + 1; if (deal === needLangs.length) { res = this.markdownIt.render(src); func(res); } }) } } 这个函数中this.markdownIt这个的this指向有问题,这个this应该改文$vm,目前的this是指向不到markdownIt的,会报错

Steps To Reproduce

Screenshots

The expected behaviour

Possible solution (optional, but very helpful)

jinwei1116 avatar Aug 03 '24 09:08 jinwei1116

有人修,但是感觉没人merge和release的样子…… https://github.com/hinesboy/mavonEditor/pull/899

thwblueboy avatar Nov 28 '24 03:11 thwblueboy

我看到已经merge和release了

thwblueboy avatar Mar 18 '25 08:03 thwblueboy