vue-json5-pretty

0.0.1 • Public • Published

vue-json5-pretty

Json5 pretty of Vue component

what is json5

https://json5.org

Usage

import Json5Pretty from 'vue-json5-pretty'
 
export default {
  component: {
    Json5Pretty
  },
  data() {
    return {
      prefix: 'json5-pretty',
      openDep: 3,
      value: {
        // comments
        unquoted: 'and you can quote me on that',
        singleQuotes: 'I can use "double quotes" here',
        lineBreaks:
          "Look, Mom! \
No \\n's!",
        hexadecimal: 0xdecaf,
        leadingDecimalPoint: 0.8675309,
        andTrailing: 8675309,
        positiveSign: +1,
        trailingComma: 'in objects',
        andIn: ['arrays'],
        backwardsCompatible: 'with JSON'
      }
    }
  }
}
<Json5Pretty :value="value" :openDep="openDep" />

Props

  • [ label ] => data key.

  • [ value ] => json5 data.

  • [ expandDepth ] => by default, the depth of this tree will expand. default: 1.

  • [ prefix ] => class prefix. default: 'json5-pretty'.

Costom Style

import Json5Pretty from 'vue-json5-pretty/src/index.vue'
import './path/to/your/style.less'
 
export default {
  component: {
    Json5Pretty
  }
}

Readme

Keywords

Package Sidebar

Install

npm i vue-json5-pretty

Weekly Downloads

0

Version

0.0.1

License

MIT

Unpacked Size

12.7 kB

Total Files

32

Last publish

Collaborators

  • ken1987