@@ -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,28 @@ 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.sync | 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.sync | Selected data path | string, array | - |
122
+ | rootPath | 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
+ | editable | Support editable | boolean | false |
130
+ | editableTrigger | Trigger | ` click ` , ` dblclick ` | ` click ` |
132
131
133
132
## Events
134
133
@@ -139,6 +138,12 @@ plugins: [
139
138
| icon-click | triggers when click icon | (collapsed: boolean) |
140
139
| selected-change | triggers when the selected value changed | (newVal, oldVal) |
141
140
141
+ ## Scoped Slots
142
+
143
+ | Slot Name | Description | Parameters |
144
+ | --------- | ----------------- | ---------------------- |
145
+ | nodeValue | render node value | { node, defaultValue } |
146
+
142
147
## Major Contributors
143
148
144
149
[ ![ ] ( https://avatars3.githubusercontent.com/u/153197?v=3&s=50 )] ( https://github.com/rchl )
0 commit comments