0
我看到有一種方法可以在摩納哥編輯器中設置scrolltop
。如何滾動到特定的行而不是特定的像素?滾動到摩納哥編輯器
我看到有一種方法可以在摩納哥編輯器中設置scrolltop
。如何滾動到特定的行而不是特定的像素?滾動到摩納哥編輯器
如在文檔:https://microsoft.github.io/monaco-editor/api/interfaces/monaco.editor.icodeeditor.html
滾動到頂部,在PX:
editor.setScrollPosition({scrollTop: 0});
滾動到某一特定行:
editor.revealLine(15);
滾動到某一特定線,使其在結束編輯中心:
editor.revealLineInCenter(15);
移動當前有效行:
editor.setPosition({column: 1, lineNumber: 3});