1

我想在grapesjs框架中包含多个页面。

4

1 回答 1

0

Grapesjs 现在支持使用 PageManager 的页面。您可以在这里查看 API 文档https://grapesjs.com/docs/api/pages.html

这样做的方法是

const editor = grapesjs.init({
 ....
 pageManager: {
   pages: [
     {
       id: 'page-id',
       styles: `.my-class { color: red }`, // or a JSON of styles
       component: '<div class="my-class">My element</div>', // or a JSON of components
     }
  ]
 },
})

您可以使用 中的方法添加、删除、选择页面grapesjs.Page

于 2022-02-16T07:42:13.533 回答