mirror of
https://github.com/directus/directus.git
synced 2026-04-25 03:00:53 -04:00
Fix layout preview being empty when editing preview (#8654)
* Fix layout preview being empty when editing preview Fixes #8645 * Remove collection prop from layout component The prop is already passed through the layout state.
This commit is contained in:
committed by
GitHub
parent
4c2de47cf3
commit
d6e40f4873
@@ -188,7 +188,7 @@ export default defineLayout<LayoutOptions, LayoutQuery>({
|
||||
|
||||
const sort = computed<string[]>({
|
||||
get() {
|
||||
return layoutQuery.value?.sort || [primaryKeyField.value!.field] || [];
|
||||
return layoutQuery.value?.sort || (primaryKeyField.value ? [primaryKeyField.value.field] : []);
|
||||
},
|
||||
set(newSort: string[]) {
|
||||
layoutQuery.value = {
|
||||
|
||||
@@ -160,7 +160,7 @@ export default defineLayout<LayoutOptions, LayoutQuery>({
|
||||
|
||||
const sort = computed<string[]>({
|
||||
get() {
|
||||
return layoutQuery.value?.sort || [primaryKeyField.value!.field] || [];
|
||||
return layoutQuery.value?.sort || (primaryKeyField.value ? [primaryKeyField.value.field] : []);
|
||||
},
|
||||
set(newSort: string[]) {
|
||||
layoutQuery.value = {
|
||||
|
||||
@@ -68,12 +68,7 @@
|
||||
<v-form v-model="edits" :fields="fields" :loading="loading" :initial-values="initialValues" :primary-key="id" />
|
||||
|
||||
<div class="layout">
|
||||
<component
|
||||
:is="`layout-${values.layout}`"
|
||||
v-if="values.layout && values.collection"
|
||||
v-bind="layoutState"
|
||||
:collection="values.collection"
|
||||
>
|
||||
<component :is="`layout-${values.layout}`" v-if="values.layout && values.collection" v-bind="layoutState">
|
||||
<template #no-results>
|
||||
<v-info :title="t('no_results')" icon="search" center>
|
||||
{{ t('no_results_copy') }}
|
||||
|
||||
Reference in New Issue
Block a user