添加字幕本地预览

This commit is contained in:
Harvey committed 2019-11-14 14:00:24 +08:00
1 parent 2878705e72
commit 9cf1571ef8
15 files changed
+279 -81

No files matched your search

+5 -1
View File
@@ -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));