Back to Grapesjs

Page

docs/api/page.md

0.22.161.1 KB
Original Source
<!-- Generated by documentation.js. Update this documentation by updating the source code. -->

getId

Get page id

Returns String

getName

Get page name

Returns String

setName

Update page name

Parameters

Examples

javascript
page.setName('New name');

getAllFrames

Get all frames

Examples

javascript
const arrayOfFrames = page.getAllFrames();

Returns Array<Frame>

getMainFrame

Get the first frame of the page (identified always as the main one)

Examples

javascript
const mainFrame = page.getMainFrame();

Returns Frame

getMainComponent

Get the root component (usually is the wrapper component) from the main frame

Examples

javascript
const rootComponent = page.getMainComponent();
console.log(rootComponent.toHTML());

Returns Component