背景
项目需要展示 JSON,想找找看有没有用户体验好且较轻量的 npm 库。
原生方案
如果不需要高亮展示,其实可以直接用原生的 JSON.stringify 实现:
1 | const JSONResult = ({ result }: { result?: any }) => { |
项目需要展示 JSON,想找找看有没有用户体验好且较轻量的 npm 库。
如果不需要高亮展示,其实可以直接用原生的 JSON.stringify 实现:
1 | const JSONResult = ({ result }: { result?: any }) => { |
Author: Dantong Luo
Permalink: https://dantongluo.vercel.app/2024/04/25/json-format-and-highlight/
License: Copyright (c) 2019 CC-BY-NC-4.0 LICENSE
Slogan: Do you believe in DESTINY?