forked from Gitlink/forgeplus-react
fix
This commit is contained in:
parent
554ff5b175
commit
080e0f6d4e
|
@ -33,10 +33,11 @@ function Quality(props){
|
||||||
useEffect(()=>{
|
useEffect(()=>{
|
||||||
if(indexValue){
|
if(indexValue){
|
||||||
// document.getElementById('htmlDOM').innerHTML
|
// document.getElementById('htmlDOM').innerHTML
|
||||||
const domBox = document.getElementsByClassName('CodeMirror-code')[0].childNodes[indexValue.line - 1]
|
|
||||||
const divs = document.createElement("div");
|
const divs = document.createElement("div");
|
||||||
|
const key = indexValue.line
|
||||||
divs.innerHTML = questionList[indexValue.index].message;
|
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;'
|
divs.style.cssText='border:1px solid red; padding: 5px;border-radius: 10px;color: black;background: lemonchiffon;'
|
||||||
}
|
}
|
||||||
},[indexValue])
|
},[indexValue])
|
||||||
|
@ -92,7 +93,9 @@ function Quality(props){
|
||||||
const dom = document.createElement("div");
|
const dom = document.createElement("div");
|
||||||
dom.innerHTML = text;
|
dom.innerHTML = text;
|
||||||
setDetail(true)
|
setDetail(true)
|
||||||
setCodeDetailValue({content:dom.innerText,line:item.line + 5})
|
setCodeDetailValue({content:dom.innerText,
|
||||||
|
line:item.line + 5
|
||||||
|
})
|
||||||
setIndexValue({
|
setIndexValue({
|
||||||
line:item.line,
|
line:item.line,
|
||||||
index
|
index
|
||||||
|
|
Loading…
Reference in New Issue