@yangsansuan/json-editor
v1.3.8
Published
扩展自[JSON编辑](https://github.com/josdejong/jsoneditor),支持了表格视图模式
Downloads
4
Readme
扩展自JSON编辑,支持了表格视图模式
usage
// step1 导入
import JSONEditor from "@yangsansuan/json-editor";
function App() {
const ref = useRef()
useEffect(() => {
const json = {
"Array": [1, 2 ,3],
"Boolean": true,
"Null": null,
"Number": 123,
"Object": {
"a": "b",
"c": "d"
},
"String": "Hello World"
}
const options = {};
// step2 创建编辑器
const editor = JSONEditor(ref.current, options);
// ste3 填入json数据
editor.set(json);
}, [])
return (
<div className="App" ref={ref}></div>
);
}