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

修复codemirror识别当前语言异常 #119

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

SilenceHS
Copy link

bug描述:第一次进入promblem页面,codemirror识别当前语言异常,总是识别成C++,导致写其他语言时智能缩进,高亮提示等工作不正常
我认为bug原因:进入父problem,子codemirror通过props接收父给的language,理论上父中改了language,子props中language也会动态的修改。但是,父获得真实的language是异步操作,父获得真实language之前,子就已经拿到了默认给的C++,可能父中异步修改的language变量不会同步到子prop?导致子的language没修改成功?以上是我猜的
修复方式:子中watch这个props就可以了,一但父中改动就会主动同步

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

Successfully merging this pull request may close these issues.

1 participant