PageConfig.vue 598 B

123456789101112131415161718192021222324252627
  1. <template>
  2. <CusForm :columns="formItems" @change="handleChange"/>
  3. </template>
  4. <script setup lang="ts">
  5. import { CusForm, IFormItem } from '@/components/CusForm';
  6. import { useProjectStore } from '@/store/modules/project';
  7. const projectStore = useProjectStore();
  8. const formItems: IFormItem[] = [
  9. {
  10. label: '页面背景',
  11. prop: 'background',
  12. type: 'backgroundSelect',
  13. defaultValue: projectStore.currentPage.background
  14. }
  15. ];
  16. const handleChange = (value: Record<string, any>) => {
  17. projectStore.setCurrentPageBackground(value.background);
  18. };
  19. </script>
  20. <style scoped>
  21. </style>