mirror of
https://github.com/directus/directus.git
synced 2026-01-28 14:28:02 -05:00
Update layout templates to new layouts system (#7726)
This commit is contained in:
committed by
GitHub
parent
d9d8edc217
commit
a137a44e24
@@ -11,8 +11,8 @@ export default {
|
||||
sidebar: () => null,
|
||||
actions: () => null,
|
||||
},
|
||||
setup(props) {
|
||||
const name = ref('Custom layout state');
|
||||
setup() {
|
||||
const name = ref('Custom Layout');
|
||||
|
||||
return { name };
|
||||
},
|
||||
|
||||
@@ -1,17 +1,21 @@
|
||||
<template>
|
||||
<div>{{ name }} - Collection: {{ props.collection }}</div>
|
||||
<div>
|
||||
<p>Name: {{ name }}</p>
|
||||
<p>Collection: {{ collection }}</p>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { toRefs } from 'vue';
|
||||
import { useLayoutState } from '@directus/extensions-sdk';
|
||||
|
||||
export default {
|
||||
setup() {
|
||||
const layoutState = useLayoutState();
|
||||
const { props, name } = toRefs(layoutState.value);
|
||||
|
||||
return { props, name };
|
||||
props: {
|
||||
collection: {
|
||||
type: String,
|
||||
required: true,
|
||||
},
|
||||
name: {
|
||||
type: String,
|
||||
required: true,
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
@@ -12,8 +12,8 @@ export default defineLayout({
|
||||
sidebar: () => null,
|
||||
actions: () => null,
|
||||
},
|
||||
setup(props) {
|
||||
const name = ref('Custom layout state');
|
||||
setup() {
|
||||
const name = ref('Custom Layout');
|
||||
|
||||
return { name };
|
||||
},
|
||||
|
||||
@@ -1,17 +1,23 @@
|
||||
<template>
|
||||
<div>{{ name }} - Collection: {{ props.collection }}</div>
|
||||
<div>
|
||||
<p>Name: {{ name }}</p>
|
||||
<p>Collection: {{ collection }}</p>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { defineComponent, toRefs } from 'vue';
|
||||
import { useLayoutState } from '@directus/extensions-sdk';
|
||||
import { defineComponent } from 'vue';
|
||||
|
||||
export default defineComponent({
|
||||
setup() {
|
||||
const layoutState = useLayoutState();
|
||||
const { props, name } = toRefs(layoutState.value);
|
||||
|
||||
return { props, name };
|
||||
props: {
|
||||
collection: {
|
||||
type: String,
|
||||
required: true,
|
||||
},
|
||||
name: {
|
||||
type: String,
|
||||
required: true,
|
||||
},
|
||||
},
|
||||
});
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user