This commit is contained in:
linlu 2022-07-14 14:54:03 +08:00
parent 554ff5b175
commit 080e0f6d4e
1 changed files with 6 additions and 3 deletions

View File

@ -33,10 +33,11 @@ function Quality(props){
useEffect(()=>{
if(indexValue){
// document.getElementById('htmlDOM').innerHTML
const domBox = document.getElementsByClassName('CodeMirror-code')[0].childNodes[indexValue.line - 1]
const divs = document.createElement("div");
const key = indexValue.line
divs.innerHTML = questionList[indexValue.index].message;
domBox.appendChild(divs)
const domBox = document.getElementsByClassName('CodeMirror-code')[0].childNodes[key]
domBox.prepend(divs)
divs.style.cssText='border:1px solid red; padding: 5px;border-radius: 10px;color: black;background: lemonchiffon;'
}
},[indexValue])
@ -92,7 +93,9 @@ function Quality(props){
const dom = document.createElement("div");
dom.innerHTML = text;
setDetail(true)
setCodeDetailValue({content:dom.innerText,line:item.line + 5})
setCodeDetailValue({content:dom.innerText,
line:item.line + 5
})
setIndexValue({
line:item.line,
index