2
0
mirror of https://github.com/tenrok/vue-json-viewer.git synced 2026-06-20 20:00:37 +03:00
This commit is contained in:
fengqi.cf
2022-03-03 19:28:04 +08:00
parent a4a149e5d6
commit c1bccc349c
8 changed files with 46 additions and 8 deletions
+11 -1
View File
@@ -10,7 +10,7 @@ import JsonDate from './types/json-date'
export default {
name: 'JsonBox',
inject: ['expandDepth'],
inject: ['expandDepth', 'onKeyclick'],
props: {
value: {
type: [Object, Array, String, Number, Boolean, Function, Date],
@@ -29,6 +29,10 @@ export default {
forceExpand: Boolean,
showArrayIndex: Boolean,
showDoubleQuotes: Boolean,
path: {
type: String,
default: '$',
},
},
data() {
return {
@@ -121,6 +125,11 @@ export default {
},
domProps: {
innerText: this.showDoubleQuotes ? `"${this.keyName}":` : `${this.keyName}:`
},
on: {
click: () => {
this.onKeyclick(this.path);
}
}
}))
}
@@ -139,6 +148,7 @@ export default {
forceExpand: this.forceExpandMe,
showArrayIndex: this.showArrayIndex,
showDoubleQuotes: this.showDoubleQuotes,
path: this.path,
},
on: {
'update:expand': value => {