feat: new layout
This commit is contained in:
@@ -27,12 +27,12 @@ const definedDynamicPageLayout: Record<string, any> = {
|
||||
'ARTICLE_LONG': ARTICLE_LONG_LAYOUT,
|
||||
}
|
||||
|
||||
const getCurrentLayout = computed(() => _props.settings && _props.settings.layout);
|
||||
const getCurrentLayout = computed(() => _props.settings.layout);
|
||||
|
||||
const GET_PROPS = computed(() => {
|
||||
return () => {
|
||||
let props: any = {};
|
||||
for (const [key, value] of _props.settings ? Object.entries(_props.settings) : []) {
|
||||
for (const [key, value] of Object.entries(_props.settings)) {
|
||||
props = {
|
||||
...props,
|
||||
[key]: value
|
||||
@@ -44,7 +44,7 @@ const GET_PROPS = computed(() => {
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<component :is="definedDynamicPageLayout[getCurrentLayout] || null" v-bind="GET_PROPS()">
|
||||
<component :is="definedDynamicPageLayout[getCurrentLayout]" v-bind="GET_PROPS()">
|
||||
<slot />
|
||||
</component>
|
||||
</template>
|
||||
|
||||
Reference in New Issue
Block a user