<template>
  <CusForm :columns="formItems" @change="handleChange"/>
</template>

<script setup lang="ts">
import { CusForm, IFormItem } from '@/components/CusForm';
import { useProjectStore } from '@/store/modules/project';

const projectStore = useProjectStore();
const formItems: IFormItem[] = [
  {
    label: '页面背景',
    prop: 'background',
    type: 'backgroundSelect',
    defaultValue: projectStore.currentPage.background
  }
];

const handleChange = (value: Record<string, any>) => {
  projectStore.setCurrentPageBackground(value.background);
};

</script>

<style scoped>

</style>