This commit is contained in:
Harvey authored and Harvey Zack committed 2022-02-11 11:20:54 +08:00
1 parent 8398305d6a
commit 5d97a622bb
2 files changed
-80

No files matched your search

@@ -738,46 +738,6 @@ art.on('ready', () => {
});
```
### add
- Type: `Function`
Method `add` can dynamically add a setting items
| Property | Type | Description |
| --------- | ------------------- | ------------------------------------------------------------- |
| `disable` | `Boolean` | Whether to disable the component |
| `name` | `String` | The unique name of the component, used to mark the class name |
| `index` | `Number` | Component index, priority for display |
| `html` | `String`、`Element` | DOM element of the component |
| `style` | `Object` | Component style object |
| `click` | `Function` | Component click event |
| `mounted` | `Function` | Triggered after the component is mounted |
| `tooltip` | `String` | Prompt text of the component |
<div className="run-code">▶ Run Code</div>
```js
var art = new Artplayer({
container: '.artplayer-app',
url: '/assets/sample/video.mp4',
setting: true,
autoSize: true,
});
art.on('ready', () => {
art.seek = 20;
art.setting.show = true;
art.setting.add({
html: 'Custom setting',
click: function () {
console.info('You click on custom settings');
art.setting.show = false;
},
});
});
```
## plugins
- Type: `Object`
@@ -730,46 +730,6 @@ art.on('ready', () => {
});
```
### add
- 类型: `Function`
方法 `add` 可以动态添加设置项
| 属性 | 类型 | 描述 |
| --------- | ------------------- | -------------------------- |
| `disable` | `Boolean` | 是否禁用组件 |
| `name` | `String` | 组件唯一名称,用于标记类名 |
| `index` | `Number` | 组件索引,用于显示的优先级 |
| `html` | `String`、`Element` | 组件的 DOM 元素 |
| `style` | `Object` | 组件样式对象 |
| `click` | `Function` | 组件点击事件 |
| `mounted` | `Function` | 组件挂载后触发 |
| `tooltip` | `String` | 组件的提示文本 |
<div className="run-code">▶ Run Code</div>
```js
var art = new Artplayer({
container: '.artplayer-app',
url: '/assets/sample/video.mp4',
setting: true,
autoSize: true,
});
art.on('ready', () => {
art.seek = 20;
art.setting.show = true;
art.setting.add({
html: '自定义设置',
click: function () {
console.info('你点击了自定义设置');
art.setting.show = false;
},
});
});
```
## plugins
- 类型: `Object`