Files
NSG_PORTAL_V2/components/dynamic-page/page/layouts/Default.vue
T

79 lines
2.0 KiB
Vue
Raw Normal View History

2024-05-30 18:06:50 +07:00
<script setup lang="ts">
2024-06-28 15:39:26 +07:00
import { getInputValue } from "@/utils/parseSQL";
2024-05-30 18:06:50 +07:00
const props = defineProps<{
2024-06-28 15:39:26 +07:00
layout?: any,
label?:any
2024-05-30 18:06:50 +07:00
}>()
const CLASS_FOR_LAYOUT = computed(() => {
let _classForLayout = {};
switch (props.layout) {
case 'Full_Page':
_classForLayout = {
2024-06-28 15:39:26 +07:00
page_container: 'page_container full-size-page',
layout_container: 'layout_container full-size-layout',
2024-05-30 18:06:50 +07:00
};
break;
case 'Center_Page':
_classForLayout = {
2024-06-28 15:39:26 +07:00
page_container: 'page_container full-size-page',
layout_container: 'layout_container center-layout',
2024-05-30 18:06:50 +07:00
};
break;
case 'Background_Page':
_classForLayout = {
2024-06-28 15:39:26 +07:00
page_container: 'page_container full-size-page background-container',
layout_container: 'layout_container center-layout',
2024-05-30 18:06:50 +07:00
};
break;
default:
_classForLayout = {
2024-06-28 15:39:26 +07:00
page_container: 'page_container',
2024-05-30 18:06:50 +07:00
layout_container: 'layout_container',
};
break;
}
return _classForLayout;
})
2024-06-28 15:39:26 +07:00
const LAYOUT_PARSE = computed(() => {
return props?.label ? getInputValue(props.label, "OBJECT") : {};
});
2024-05-30 18:06:50 +07:00
</script>
<template>
2024-06-28 15:39:26 +07:00
<div :class="[CLASS_FOR_LAYOUT.page_container]" :style="LAYOUT_PARSE['div.page_container']">
<div :class="[CLASS_FOR_LAYOUT.layout_container]" class="grid-container">
2024-05-30 18:06:50 +07:00
<slot />
</div>
</div>
</template>
<style lang="scss" scoped>
2024-06-28 15:39:26 +07:00
.page_container {
&.full-size-page {
width: 100%;
}
.full-size-layout {
padding-left: 20px;
padding-right: 20px;
}
}
.layout_container {
padding-top: 40px;
padding-bottom: 40px;
2024-05-30 18:06:50 +07:00
2024-06-28 15:39:26 +07:00
&.center-layout {
max-width: 1300px;
margin: auto;
}
}
.grid-container {
display: grid;
grid-template-columns: repeat(1, minmax(0, 1fr));
/* gap: 40px; */
}
2024-05-30 18:06:50 +07:00
</style>