mirror of
https://github.com/directus/directus.git
synced 2026-02-19 10:14:33 -05:00
Date display (#541)
* Add datetime display * Pass type to displays * Fix types
This commit is contained in:
@@ -12,7 +12,7 @@ export default defineComponent({
|
||||
props: {
|
||||
value: {
|
||||
type: String,
|
||||
required: true,
|
||||
default: 'tabular',
|
||||
},
|
||||
},
|
||||
setup(props, { emit }) {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<value-null v-if="value === null || value === undefined" />
|
||||
<span v-else-if="displayInfo === null">{{ value }}</span>
|
||||
<span v-else-if="typeof displayInfo.handler === 'function'">
|
||||
{{ display.handler(value, options) }}
|
||||
{{ display.handler(value, options, { type }) }}
|
||||
</span>
|
||||
<component
|
||||
v-else
|
||||
@@ -11,6 +11,7 @@
|
||||
:interface="$props.interface"
|
||||
:interface-options="interfaceOptions"
|
||||
:value="value"
|
||||
:type="type"
|
||||
/>
|
||||
</template>
|
||||
|
||||
@@ -42,6 +43,10 @@ export default defineComponent({
|
||||
type: [String, Number, Object, Array],
|
||||
default: null,
|
||||
},
|
||||
type: {
|
||||
type: String,
|
||||
required: true,
|
||||
},
|
||||
},
|
||||
setup(props) {
|
||||
const displayInfo = computed(
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
:value="part.value"
|
||||
:interface="part.interface"
|
||||
:interface-options="part.interfaceOptions"
|
||||
:type="part.type"
|
||||
v-bind="part.options"
|
||||
/>
|
||||
<template v-else>{{ part }}</template>
|
||||
@@ -80,6 +81,7 @@ export default defineComponent({
|
||||
value: value,
|
||||
interface: field.interface,
|
||||
interfaceOptions: field.options,
|
||||
type: field.type,
|
||||
};
|
||||
})
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user