我是 React 和 Ant Design 的新手。Ant design 的折叠小部件允许所有项目打开,但是没有办法预烘焙方式将项目设置为默认全部打开 - 您只能设置单个折叠单元默认打开
defaultActiveKey={['1']}
Run Code Online (Sandbox Code Playgroud)
我如何默认打开全部?
所以,我需要逐行读取文本文件,并按字符串返回它们.我可以指定从哪行到哪一行我想读它.
我的班有3种方法:
public class FilePartReader {
String filePath;
Integer fromLine;
Integer toLine;
public FilePartReader() { }
public void setup(String filepath, Integer fromLine, Integer toLine) {
if (fromLine < 0 || toLine <= fromLine) {
throw new IllegalArgumentException(
"fromline cant be smaller than 0 and toline cant be smaller than fromline");
}
this.filePath = filepath;
this.fromLine = fromLine;
this.toLine = toLine;
}
public String read() throws IOException {
String data;
data = new String(Files.readAllBytes(Paths.get(filePath)));
return data;
}
public String readLines() { …Run Code Online (Sandbox Code Playgroud)