@@ -66,7 +66,7 @@ The CSS file is included separately and needs to be imported manually. You can e
66
66
``` vue
67
67
<template>
68
68
<div>
69
- <vue-json-pretty :path="'res'" : data="{ key: 'value' }" @click="handleClick " />
69
+ <vue-json-pretty :data="{ key: 'value' }" />
70
70
</div>
71
71
</template>
72
72
@@ -106,29 +106,29 @@ plugins: [
106
106
107
107
## Props
108
108
109
- | Property | Description | Type | Default |
110
- | ------------------------ | ----------------------------------------------- | ---------------------------------------- | ------- |
111
- | data(v-model) | JSON data, support v-model when use editable | JSON object | - |
112
- | deep | Paths greater than this depth will be collapsed | number | - |
113
- | showLength | Show the length when collapsed | boolean | false |
114
- | showLine | Show the line | boolean | true |
115
- | showLineNumber | Show the line number | boolean | false |
116
- | showIcon | Show the icon | boolean | false |
117
- | showDoubleQuotes | Show doublequotes on key | boolean | true |
118
- | virtual | Use virtual scroll | boolean | false |
119
- | height | The height of list when using virtual | number | 400 |
120
- | itemHeight | The height of node when using virtual | number | 20 |
121
- | selectedValue(v-model) | Selected data path | string, array | - |
122
- | path | Root data path | string | ' root' |
123
- | pathSelectable | Defines whether a data path supports selection | function (path, content) | - |
124
- | selectableType | Support path select, default none | ` multiple ` , ` single ` | - |
125
- | showSelectController | Show the select controller | boolean | false |
126
- | selectOnClickNode | Trigger select when click node | boolean | true |
127
- | highlightSelectedNode | Support highlighting selected nodes | boolean | true |
128
- | collapsedOnClickBrackets | Support click brackets to collapse | boolean | true |
129
- | customValueFormatter | Custom value rendering function | function(data, key, path, defaultResult) | - |
130
- | editable | Support editable | boolean | false |
131
- | editableTrigger | Trigger | ` click ` , ` dblclick ` | ' click' |
109
+ | Property | Description | Type | Default |
110
+ | ------------------------ | ----------------------------------------------- | --------------------------------- | ------- |
111
+ | data(v-model) | JSON data, support v-model when use editable | JSON object | - |
112
+ | deep | Paths greater than this depth will be collapsed | number | - |
113
+ | showLength | Show the length when collapsed | boolean | false |
114
+ | showLine | Show the line | boolean | true |
115
+ | showLineNumber | Show the line number | boolean | false |
116
+ | showIcon | Show the icon | boolean | false |
117
+ | showDoubleQuotes | Show doublequotes on key | boolean | true |
118
+ | virtual | Use virtual scroll | boolean | false |
119
+ | height | The height of list when using virtual | number | 400 |
120
+ | itemHeight | The height of node when using virtual | number | 20 |
121
+ | selectedValue(v-model) | Selected data path | string, array | - |
122
+ | rootPath | Root data path | string | ` root ` |
123
+ | pathSelectable | Defines whether a path supports selection | (path, content) => boolean | - |
124
+ | selectableType | Support path select, default none | ` multiple ` \| ` single ` | - |
125
+ | showSelectController | Show the select controller | boolean | false |
126
+ | selectOnClickNode | Trigger select when click node | boolean | true |
127
+ | highlightSelectedNode | Support highlighting selected nodes | boolean | true |
128
+ | collapsedOnClickBrackets | Support click brackets to collapse | boolean | true |
129
+ | renderNodeValue | render node value, or use slot #renderNodeValue | ({ node, defaultValue }) => vNode | - |
130
+ | editable | Support editable | boolean | false |
131
+ | editableTrigger | Trigger | ` click ` \| ` dblclick ` | ` click ` |
132
132
133
133
## Events
134
134
@@ -139,6 +139,12 @@ plugins: [
139
139
| iconClick | triggers when click icon | (collapsed: boolean) |
140
140
| selectedChange | triggers when the selected value changed | (newVal, oldVal) |
141
141
142
+ ## Scoped Slots
143
+
144
+ | Slot Name | Description | Parameters |
145
+ | --------------- | ----------------- | ---------------------- |
146
+ | renderNodeValue | render node value | { node, defaultValue } |
147
+
142
148
## Major Contributors
143
149
144
150
[ ![ ] ( https://avatars3.githubusercontent.com/u/153197?v=3&s=50 )] ( https://github.com/rchl )
0 commit comments