Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
bug描述:第一次进入promblem页面,codemirror识别当前语言异常,总是识别成C++,导致写其他语言时智能缩进,高亮提示等工作不正常
我认为bug原因:进入父problem,子codemirror通过props接收父给的language,理论上父中改了language,子props中language也会动态的修改。但是,父获得真实的language是异步操作,父获得真实language之前,子就已经拿到了默认给的C++,可能父中异步修改的language变量不会同步到子prop?导致子的language没修改成功?以上是我猜的
修复方式:子中watch这个props就可以了,一但父中改动就会主动同步