Skip to content

JSON 显示

上网找了个高亮不同类型数据的函数,简单处理了一下,就可以显示在页面上了

INFO

无需引入,可直接使用

Props

名称类型默认值说明
valueobject/arrayundefined要显示的值
heightstring100px元素的高度
widthstring100%元素的宽度

Usage

vue
<script>
const value = [
  { key1: 'value1' },
  { key2: true },
  { key3: 999 },
  { key4: null },
]
</script>

<template>
  <w-JSON :value="value" />
</template>

Released under the MIT License.