2
0
mirror of https://github.com/tenrok/vue-json-viewer.git synced 2026-06-20 20:00:37 +03:00

Add support for Date's

Fixes #47
This commit is contained in:
Rocco Bruyn
2020-06-14 17:40:19 +02:00
parent d27a9f7f3e
commit 262d94f7e0
3 changed files with 35 additions and 7 deletions
+25
View File
@@ -0,0 +1,25 @@
<script>
export default {
name: 'JsonDate',
functional: true,
props: {
jsonValue: {
type: Date,
required: true
}
},
render (h, { props }) {
const value = props.jsonValue;
return h('span', {
class: {
'jv-item': true,
'jv-string': true,
},
domProps: {
innerText: `"${value.toLocaleString()}"`
}
})
}
};
</script>