컬럼 레이아웃
<template>
<div style="width: 1000px; height: 400px">
<RealGridVue
ref="gridView"
:rows="rows"
:layout="gridLayout"
>
<template v-for="(field, index) in fields" :key="field">
<RGDataField
:field-name="field"
/>
<RGDataColumn
:field-name="field"
:name="`field"
:width="100"
/>
</template>
</RealGridVue>
</div>
</template>
<script setup lang="ts">
import { ref } from 'vue';
import * as RealGrid from 'realgrid';
import { RealGridVue, RGDataField, RGDataColumn } from 'realgrid-vue';
const gridRef = ref<RealGridVue>();
const rows = [
{text1:"텍스트1", text2:"텍스트2", text3:"텍스트3", text4:"텍스트4", text5: "텍스트5", text6:"텍스트6", text7:"텍스트7"},
{text1:"텍스트1", text2:"텍스트2", text3:"텍스트3", text4:"텍스트4", text5: "텍스트5", text6:"텍스트6", text7:"텍스트7"},
];
const fields = ["text1", "text2", "text3", "text4", "text5", "text6", "text7"];
const gridLayout = [
"text1",
"text2",
{
name: "group1",
direction: RealGrid.ColumnLayoutDirection.VERTICAL,
items:["text3","text4"]
},{
name: "group2",
direction: RealGrid.ColumnLayoutDirection.HORIZONTAL,
items:["text5","text6"]
},
"text7"
];
</script>
컬럼 그룹 데모를 참조하세요.