mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-18 02:21:20 -08:00
添加字幕本地预览
This commit is contained in:
1 parent
2878705e72
commit
9cf1571ef8
15 files changed
+279
-81
No files matched your search
@@ -1,4 +1,4 @@
|
||||
import { append, setStyles, setStyle, remove, errorHandle, hasOwnProperty } from './index';
|
||||
import { append, setStyles, setStyle, remove, errorHandle, hasOwnProperty, tooltip } from './index';
|
||||
|
||||
export default function component(art, parent, target, getOption, callback, title) {
|
||||
const option = typeof getOption === 'function' ? getOption(art) : getOption;
|
||||
@@ -20,6 +20,10 @@ export default function component(art, parent, target, getOption, callback, titl
|
||||
setStyles($element, option.style);
|
||||
}
|
||||
|
||||
if (option.tooltip) {
|
||||
tooltip($element, option.tooltip);
|
||||
}
|
||||
|
||||
const childs = Array.from(target.children);
|
||||
$element.dataset.index = option.index || componentID;
|
||||
const nextChild = childs.find(item => Number(item.dataset.index) >= Number($element.dataset.index));
|
||||
|
||||
Reference in new issue
Block a user