DesignComp.ts 322 B

123456789101112131415
  1. import { nanoid } from "nanoid";
  2. import components from "../../components";
  3. export class DesignComp {
  4. id = nanoid();
  5. compKey: keyof typeof components.CompUI = "Text";
  6. props = {
  7. value: undefined as any
  8. };
  9. constructor(data?: Partial<DesignComp>) {
  10. if (!data) return;
  11. Object.assign(this, data);
  12. }
  13. }