mirror of
https://github.com/tenrok/vue-json-viewer.git
synced 2026-06-05 16:42:30 +03:00
Merge pull request #88 from vikrambiwal/master
Add support for Double Quotes on keys
This commit is contained in:
@@ -161,6 +161,7 @@ import 'vue-json-viewer/style.css'
|
||||
| `timeformat` | custom time format function | time => time.toLocaleString() |
|
||||
| `preview-mode` | no expand mode | `false` |
|
||||
| `show-array-index` | array show index | `true` |
|
||||
| `show-double-quotes` | show double quotes | `true` |
|
||||
|
||||
|
||||
## Listeners
|
||||
|
||||
+3
-1
@@ -28,6 +28,7 @@ export default {
|
||||
previewMode: Boolean,
|
||||
forceExpand: Boolean,
|
||||
showArrayIndex: Boolean,
|
||||
showDoubleQuotes: Boolean,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@@ -119,7 +120,7 @@ export default {
|
||||
'jv-key': true
|
||||
},
|
||||
domProps: {
|
||||
innerText: `${this.keyName}:`
|
||||
innerText: this.showDoubleQuotes ? `"${this.keyName}":` : `${this.keyName}:`
|
||||
}
|
||||
}))
|
||||
}
|
||||
@@ -137,6 +138,7 @@ export default {
|
||||
previewMode: this.previewMode,
|
||||
forceExpand: this.forceExpandMe,
|
||||
showArrayIndex: this.showArrayIndex,
|
||||
showDoubleQuotes: this.showDoubleQuotes,
|
||||
},
|
||||
on: {
|
||||
'update:expand': value => {
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
:sort="sort"
|
||||
:preview-mode="previewMode"
|
||||
:show-array-index="showArrayIndex"
|
||||
:show-double-quotes="showDoubleQuotes"
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
@@ -96,6 +97,10 @@ export default {
|
||||
showArrayIndex: {
|
||||
type: Boolean,
|
||||
default: true,
|
||||
},
|
||||
showDoubleQuotes: {
|
||||
type: Boolean,
|
||||
default: true,
|
||||
}
|
||||
},
|
||||
provide () {
|
||||
|
||||
@@ -21,6 +21,7 @@ export default {
|
||||
forceExpand: Boolean,
|
||||
previewMode: Boolean,
|
||||
showArrayIndex: Boolean,
|
||||
showDoubleQuotes: Boolean,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@@ -108,6 +109,7 @@ export default {
|
||||
previewMode: this.previewMode,
|
||||
forceExpand: this.forceExpand,
|
||||
showArrayIndex: this.showArrayIndex,
|
||||
showDoubleQuotes: this.showDoubleQuotes,
|
||||
}
|
||||
}))
|
||||
})
|
||||
|
||||
@@ -21,6 +21,7 @@ export default {
|
||||
sort: Boolean,
|
||||
previewMode: Boolean,
|
||||
showArrayIndex: Boolean,
|
||||
showDoubleQuotes: Boolean,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@@ -119,6 +120,7 @@ export default {
|
||||
previewMode: this.previewMode,
|
||||
forceExpand: this.forceExpand,
|
||||
showArrayIndex: this.showArrayIndex,
|
||||
showDoubleQuotes: this.showDoubleQuotes,
|
||||
}
|
||||
}))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user