mirror of
https://github.com/directus/directus.git
synced 2026-01-27 00:48:16 -05:00
Provide form values to children
This commit is contained in:
@@ -31,7 +31,7 @@
|
||||
<script lang="ts">
|
||||
import { defineComponent, PropType, computed } from '@vue/composition-api';
|
||||
import { Field } from '@/types';
|
||||
import interfaces from '@/interfaces';
|
||||
import { getInterfaces } from '@/interfaces';
|
||||
|
||||
export default defineComponent({
|
||||
props: {
|
||||
@@ -65,8 +65,10 @@ export default defineComponent({
|
||||
},
|
||||
},
|
||||
setup(props) {
|
||||
const interfaces = getInterfaces();
|
||||
|
||||
const interfaceExists = computed(() => {
|
||||
return !!interfaces.find((inter) => inter.id === props.field.meta.interface);
|
||||
return !!interfaces.value.find((inter) => inter.id === props.field.meta.interface);
|
||||
});
|
||||
|
||||
return { interfaceExists };
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { defineComponent, PropType, computed, ref } from '@vue/composition-api';
|
||||
import { defineComponent, PropType, computed, ref, provide } from '@vue/composition-api';
|
||||
import { useFieldsStore } from '@/stores/';
|
||||
import { Field } from '@/types';
|
||||
import { useElementSize } from '@/composables/use-element-size';
|
||||
@@ -83,6 +83,8 @@ export default defineComponent({
|
||||
|
||||
const { toggleBatchField, batchActiveFields } = useBatch();
|
||||
|
||||
provide('form-values', values);
|
||||
|
||||
return {
|
||||
el,
|
||||
formFields,
|
||||
@@ -115,7 +117,7 @@ export default defineComponent({
|
||||
const gridClass = computed<string | null>(() => {
|
||||
if (el.value === null) return null;
|
||||
|
||||
if (width.value > 612 && width.value <= 792) {
|
||||
if (width.value > 588 && width.value <= 792) {
|
||||
return 'grid';
|
||||
} else {
|
||||
return 'grid with-fill';
|
||||
|
||||
Reference in New Issue
Block a user