## Component -- `$e.components.get('document/elements')`
* **Name**: Elements.
* **Description**: Provides a way to manipulate and perform actions on the currently edited document: create, edit, delete, copy, paste, select, deselect, etc. It's possible using elements [Container](#) instances.
## Component `document/elements/` -- Commands
| Command | Access | Description
|------------------------------------------------------------------------|----------------------------------------------------|-----------------------------------------
| [Copy](#copy-command----erundocumentelementscopy) | `$e.run('document/elements/copy')` | Copy element.
| [Copy-All](#copyall-command----erundocumentelementscopy-all) | `$e.run('document/elements/copy-all')` | Copy all elements in the document.
| [Create](#create-command----erundocumentelementscreate) | `$e.run('document/elements/create')` | Create element.
| [Delete](#delete-command----erundocumentelementsdelete) | `$e.run('document/elements/delete')` | Delete element.
| [Duplicate](#duplicate-command----erundocumentelementsduplicate) | `$e.run('document/elements/duplicate')` | Duplicate element.
| [Empty](#empty-command----erundocumentelementsempty) | `$e.run('document/elements/empty')` | Empty document element.
| [Import](#import-command----erundocumentelementsimport) | `$e.run('document/elements/import')` | Import elements.
| [Paste](#paste-command----erundocumentelementspaste) | `$e.run('document/elements/paste')` | Paste new element(s) into an existing element/document.
| [Paste-Style](#paste-style-command----erundocumentelementspaste-style) | `$e.run('document/elements/paste-style')` | Paste style to element.
| [Reset-Style](#reset-style-command----erundocumentelementsreset-style) | `$e.run('document/elements/reset-style')` | Reset style to element.
| [Settings](#settings-command----erundocumentelementssettings) | `$e.run('document/elements/settings')` | Change settings of an element.
## Copy _Command_ -- `$e.run('document/elements/copy')`
* **Name**: Copy.
* **Description**: Copy element.
* **Returns**: `{void}`
* **Arguments**:
| Property | Type | Description |
|--- |--- |---|
| _container_ | `{Container}` | Target.
| _containers_ | `{Container[]}` | Targets.
| _storageKey_ | `{String}` | default: `{'clipboard'}`.
## CopyAll _Command_ -- `$e.run('document/elements/copy-all')`
* **Name**: Copy-All.
* **Description**: Copy all elements in the document.
* **Returns**: `{void}`
* **Arguments**: None.
## Create _Command_ -- `$e.run('document/elements/create')`
* **Name**: Create.
* **Description**: Create element from model.
* **Returns**: `{Container | Container[]}` *Created container(s)*.
* **Arguments**:
| Property | Type | Description |
|--- |--- |---|
| _container_ | `{Container}` | Target.
| _containers_ | `{Container[]}` | Targets.
| _model_ | `{Object}` | Model to create.
| _options_ | `{Object}` | Options.
**_options:_**
| Property | Type | Default | Description |
|-------------|-----------------------------------|-----------|----------------------------------------|
| at | `{Number}` | `{null}` | Index position (`null` means last).
| clone | `{Boolean}` | `{false}` | Generate unique id for the model.
| edit | `{Boolean}` | `{false}` | Whether to open the panel for editing after creating the element.
| onBeforeAdd | `{function()}` | | Run callback before add.
| onAfterAdd | `{function( newModel, newView )}` | | Run callback after add.
| trigger | `{Boolean}` | `{false}` | *Deprecated*.
* **Examples**:
Create Heading widget
```javascript
// Create section.
const eSection = $e.run( 'document/elements/create', {
container: elementor.getPreviewContainer(),
columns: 1,
model: { elType: 'section' },
} );
```
Result:
![empty-column](./_images/empty-column.png)
Now, in order to create the widget, we need a column. There are two ways to access the automatically created column, depends on the context. When the section's container instance is available, we can simply access its children:
```javascript
const eColumn = eSection.children[ 0 ];
```
In other cases, where a the column's container-id is provided, we can retrieve the corresponding container instance:
```javascript
const eColumn = elementor.getContainer('cb70e3c');
```
Finally, the heading widget can be created at the selected column:
```javascript
$e.run( 'document/elements/create', {
container: eColumn,
model: {
elType: 'widget',
widgetType: 'heading',
},
} );
```
Result:
![widget-heading](./_images/widget-heading.png)
## Delete _Command_ -- `$e.run('document/elements/delete')`
* **Name**: Delete.
* **Description**: Delete element.
* **Returns**: `{Container | Container[]}` *Deleted container(s)*.
* **Arguments**:
| Property | Type | Description |
|--- |--- |---|
| _container_ | `{Container}` | Target.
| _containers_ | `{Container[]}` | Targets.
* **Examples**:
Delete a section, Assuming we have this section, and want to delete it.
![widget-heading](./_images/widget-heading.png)
```javascript
// Get section container.
const eSection = elementor.getContainer( '886643f' );
$e.run( 'document/elements/delete', {
container: eSection,
} );
```
Result: The section and all of its child elements are deleted.
## Duplicate _Command_ -- `$e.run('document/elements/duplicate')`
* **Name**: Duplicate.
* **Description**: Duplicate element.
* **Returns**: `{Container | Container[]}` *Created container(s)*.
* **Arguments**:
| Property | Type | Description |
|--- |--- |---|
| _container_ | `{Container}` | Target.
| _containers_ | `{Container[]}` | Targets.
* **Examples**:
Duplicating a section.
![widget-heading](./_images/widget-heading.png)
```javascript
// Get section container.
const eSection = elementor.getContainer( '886643f' );
$e.run( 'document/elements/duplicate', {
container: eSection,
} );
```
Result:
![widget-heading-duplicated](./_images/widget-heading-duplicated.png)
## Empty _Command_ -- `$e.run('document/elements/empty')`
* **Name**: Empty.
* **Description**: Delete all elements from the document.
* **Returns**: `{void}`
| Property | Type | Requirement | Description |
|--- |--- |--- |---|
| _force_ | `{Boolean}` | **optional** | default: `{false}`, if true will delete all elements without confirmation.
## Import _Command_ -- `$e.run('document/elements/import')`
* **Name**: Import.
* **Description**: Import elements.
* **Returns**: `{Container | Container[]}` *Imported container(s)*.
* **Arguments**:
| Property | Type | Requirement | Description |
|--- |--- |--- |---|
| _model_ | `{Backbone.Model}` | **required** | Template model.
| _data_ | `{Object}` | **required** | Data.
| _
没有合适的资源?快使用搜索试试~ 我知道了~
先进的前端拖放页面生成器:一款先进的前端拖放页面生成器,旨在以创纪录的速度创建高端、像素完美的网站
共2000个文件
js:1595个
json:117个
svg:68个
0 下载量 72 浏览量
2024-03-20
11:22:47
上传
评论
收藏 45.4MB ZIP 举报
温馨提示
一款先进的前端拖放页面生成器,旨在以创纪录的速度创建高端、像素完美的网站。无论您是网站开发新手还是专业设计师,Elementor都提供了直观的工具和界面,使您能够轻松设计和构建美观的网站。它支持任何WordPress主题、任何页面和任何设计。Elementor是一个强大的工具,可帮助您将创意转化为出色的网页。
资源推荐
资源详情
资源评论
收起资源包目录
先进的前端拖放页面生成器:一款先进的前端拖放页面生成器,旨在以创纪录的速度创建高端、像素完美的网站 (2000个子文件)
.browserslistrc 25B
all.css 72KB
fontawesome.css 70KB
all.min.css 58KB
fontawesome.min.css 57KB
v4-shims.css 40KB
font-awesome.css 38KB
font-awesome.min.css 30KB
v4-shims.min.css 26KB
elementor-icons.css 23KB
flatpickr.css 21KB
elementor-icons.min.css 19KB
swiper.css 19KB
animations.min.css 18KB
e-select2.css 17KB
flatpickr.min.css 17KB
swiper.min.css 16KB
e-select2.min.css 14KB
animate.css 13KB
hover.css 10KB
hover.min.css 10KB
monolith.min.css 9KB
animate.min.css 8KB
svg-with-js.css 8KB
svg-with-js.min.css 6KB
e-gallery.css 4KB
e-gallery.min.css 3KB
regular.css 734B
brands.css 732B
solid.css 727B
regular.min.css 677B
brands.min.css 675B
solid.min.css 669B
.editorconfig 403B
eicons.eot 213KB
fa-solid-900.eot 198KB
fontawesome-webfont.eot 162KB
fa-brands-400.eot 148KB
fa-regular-400.eot 33KB
elementor-github-cover.gif 1.79MB
.gitattributes 19B
index.html 1KB
Blank_Preview.jpg 17KB
swiper.js 314KB
swiper.js 297KB
jquery-ui.min.js 235KB
e-select2.full.js 163KB
swiper.min.js 140KB
swiper.min.js 136KB
backbone.marionette.js 130KB
react-dom.min.js 111KB
jquery.js 95KB
nouislider.js 85KB
e-select2.full.min.js 74KB
flatpickr.js 73KB
e-gallery.js 49KB
editor-base.js 47KB
backbone.marionette.min.js 44KB
flatpickr.min.js 43KB
mapping.js 40KB
perfect-scrollbar.js 34KB
inline-editor.js 31KB
lightbox.js 29KB
base.js 28KB
pickr.min.js 23KB
nouislider.min.js 22KB
backbone.min.js 22KB
dialog.js 20KB
app.js 20KB
helpers.js 18KB
admin.js 18KB
perfect-scrollbar.min.js 18KB
waypoints.js 18KB
container.js 17KB
inline-editor.min.js 17KB
v4-shims.js 17KB
routes.spec.js 16KB
underscore.min.js 16KB
container.js 15KB
data.spec.js 15KB
e-gallery.min.js 15KB
data.js 15KB
v4-shims.min.js 15KB
solid.js 14KB
global-select-behavior.js 14KB
commands.js 14KB
nested-tabs.js 14KB
react.min.js 13KB
base-data.js 13KB
create.spec.js 13KB
i18n.min.js 13KB
base-carousel.js 12KB
media.js 12KB
image-tools-panel.js 12KB
imagesloaded.js 12KB
convert.test.js 12KB
waypoints.min.js 12KB
jquery-html5-dnd.js 12KB
presets-factory.js 12KB
grid-container.js 11KB
共 2000 条
- 1
- 2
- 3
- 4
- 5
- 6
- 20
资源评论
UnknownToKnown
- 粉丝: 1w+
- 资源: 773
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功