mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-21 12:41:20 -08:00
组件添加add方法
This commit is contained in:
1 parent
1d859e2049
commit
2fcd44e8e7
28 files changed
+303
-328
No files matched your search
@@ -1,6 +1,5 @@
|
||||
import { setStyle } from '../utils';
|
||||
import Component from '../utils/components';
|
||||
import component from '../utils/component';
|
||||
import Component from '../utils/component';
|
||||
import playbackRate from './playbackRate';
|
||||
import aspectRatio from './aspectRatio';
|
||||
import info from './info';
|
||||
@@ -11,6 +10,8 @@ export default class Contextmenu extends Component {
|
||||
constructor(art) {
|
||||
super(art);
|
||||
|
||||
this.$parent = art.template.$contextmenu;
|
||||
|
||||
art.on('ready', () => {
|
||||
const {
|
||||
option,
|
||||
@@ -65,7 +66,7 @@ export default class Contextmenu extends Component {
|
||||
proxy($player, 'contextmenu', event => {
|
||||
event.preventDefault();
|
||||
this.show = true;
|
||||
|
||||
|
||||
const mouseX = event.clientX;
|
||||
const mouseY = event.clientY;
|
||||
const { height: cHeight, width: cWidth, left: cLeft, top: cTop } = $player.getBoundingClientRect();
|
||||
@@ -96,10 +97,4 @@ export default class Contextmenu extends Component {
|
||||
this.show = false;
|
||||
});
|
||||
}
|
||||
|
||||
add(item, callback) {
|
||||
this.id += 1;
|
||||
const { $contextmenu } = this.art.template;
|
||||
return component(this.art, this, $contextmenu, item, callback, 'contextmenu');
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user