Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] markdownIt的this指向问题 #898

Open
jinwei1116 opened this issue Aug 3, 2024 · 1 comment
Open

[Bug] markdownIt的this指向问题 #898

jinwei1116 opened this issue Aug 3, 2024 · 1 comment

Comments

@jinwei1116
Copy link

🐛 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)

@thwblueboy
Copy link

有人修,但是感觉没人merge和release的样子……
#899

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants