mirror of
https://github.com/tenrok/vue-json-viewer.git
synced 2026-06-20 20:00:37 +03:00
feat: add timeformat props
This commit is contained in:
+10
-5
@@ -80,10 +80,15 @@ export default {
|
||||
type: String,
|
||||
default: 'jv-light'
|
||||
},
|
||||
timeformat: {
|
||||
type: Function,
|
||||
default: value => value.toLocaleString(),
|
||||
}
|
||||
},
|
||||
provide () {
|
||||
return {
|
||||
expandDepth: this.expandDepth,
|
||||
timeformat: this.timeformat,
|
||||
}
|
||||
},
|
||||
data () {
|
||||
@@ -93,11 +98,6 @@ export default {
|
||||
expandCode: this.expanded
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
value() {
|
||||
this.onResized()
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
jvClass() {
|
||||
return 'jv-container ' + this.theme + (this.boxed ? ' boxed' : '')
|
||||
@@ -112,6 +112,11 @@ export default {
|
||||
}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
value() {
|
||||
this.onResized()
|
||||
}
|
||||
},
|
||||
mounted: function () {
|
||||
this.debounceResized = debounce(this.debResized.bind(this), 200);
|
||||
if (this.boxed && this.$refs.jsonBox) {
|
||||
|
||||
Reference in New Issue
Block a user