PageForm.tsx 853 B

12345678910111213141516171819202122232425262728293031323334
  1. import { DesignComp } from "@/modules/editor/objects/DesignTemp/DesignComp";
  2. import FormUI, { ColumnItem } from "@queenjs/components/FormUI";
  3. import { set } from "lodash";
  4. import { defineComponent } from "vue";
  5. import { any } from "vue-types";
  6. const styleColumns: ColumnItem[] = [
  7. {
  8. label: "内边距",
  9. dataIndex: "padding",
  10. component: "Input",
  11. },
  12. ];
  13. export const PageForm = defineComponent({
  14. props: {
  15. component: any<DesignComp>().isRequired,
  16. },
  17. setup(props) {
  18. function changeVal(e: { dataIndex: string; value: any }) {
  19. set(props.component.layout, e.dataIndex, e.value);
  20. }
  21. return () => {
  22. const { layout } = props.component;
  23. return (
  24. <>
  25. <div>页面样式</div>
  26. <FormUI data={layout} columns={styleColumns} onChange={changeVal} />
  27. </>
  28. );
  29. };
  30. },
  31. });