Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to load data on load of editor? #37

Closed
ArchanaSharma95 opened this issue Jul 6, 2020 · 1 comment
Closed

How to load data on load of editor? #37

ArchanaSharma95 opened this issue Jul 6, 2020 · 1 comment

Comments

@ArchanaSharma95
Copy link

I want to load data from html file on editor load, please tell me the event and prop to load data when the editor initialised.
Also needs an event to export html from editor. Basically I want to add "Import" and "Export HTML" button at the top of editor.

@thanhtunguet
Copy link
Owner

I want to load data from html file on editor load, please tell me the event and prop to load data when the editor initialised.
Also needs an event to export html from editor. Basically I want to add "Import" and "Export HTML" button at the top of editor.

Please see Editor component's props interface:

export interface EditorProps {
  id?: string;

  presetType?: SupportedPresetType;

  plugins?: string[];

  storageManager?: any;

  blockManager?: any;

  styleManager?: {};

  width?: string | number;

  height?: string | number;

  components?: object[];

  blocks?: object[];

  onInit?(editor: IEditor): void;

  onDestroy?(editor: IEditor): void;
}

Using onInit prop. You might want to read Grapesjs official documentation for editor api references.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants