VUE中字符串实现JSON格式化展示。
2021-04-05 10:27
标签:dep str cin mode border bre his director initial 需求是这样的: 遇到的问题是这样的: 我是这样解决的: JSON文件转字符串: 前端Vue处理: :value放字符串 vue-json-viewer教程: 官方: https://www.npmjs.com/package/vue-json-viewer 安装: $ npm install vue-json-viewer --save 引用: VUE中字符串实现JSON格式化展示。 标签:dep str cin mode border bre his director initial 原文地址:https://www.cnblogs.com/liruilong/p/12510089.html
public static String readJson(File file) {
String string = null;
if (!file.exists() || file.isDirectory()) {
System.out.println("输入路径不对");
} else {
FileInputStream fileInputStream = null;
InputStreamReader inputStreamReader = null;
BufferedReader bufferedReader = null;
try {
fileInputStream = new FileInputStream(file);
inputStreamReader = new InputStreamReader(fileInputStream, "UTF-8");
bufferedReader = new BufferedReader(inputStreamReader);
String str = null;
StringBuilder stringBuilder = new StringBuilder();
while ((str = bufferedReader.readLine()) != null) {
stringBuilder.append(str);
}
string = stringBuilder.toString();
} catch (IOException e) {
e.printStackTrace();
}
}
logger.info(string);
return string;
}
Property
Description
Default
value
JSON data (can be used with
v-model
)Required
expand-depth
Collapse blocs under this depth
1
copyable
Display the copy button, you can customize copy text just set
{copyText: ‘copy‘, copiedText: ‘copied‘}
or set true
use default copytextfalse
sort
Sort keys before displaying
false
boxed
Add a fancy "boxed" style to component
false
theme
Add a custom CSS class for theming purposes
jv-light
文章标题:VUE中字符串实现JSON格式化展示。
文章链接:http://soscw.com/index.php/essay/71969.html