1 | ;
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | exports.pathIn = void 0;
|
4 | /**
|
5 | * @ignore
|
6 | * 入场动画
|
7 | * path 的入场动画
|
8 | * @param element 执行动画的元素
|
9 | * @param animateCfg 动画配置
|
10 | * @param cfg 额外信息
|
11 | */
|
12 | function pathIn(element, animateCfg, cfg) {
|
13 | // @ts-ignore
|
14 | var length = element.getTotalLength();
|
15 | // 设置虚线样式
|
16 | element.attr('lineDash', [length]);
|
17 | element.animate(function (ratio) {
|
18 | return {
|
19 | // 对虚线偏移量做动画
|
20 | lineDashOffset: (1 - ratio) * length,
|
21 | };
|
22 | }, animateCfg);
|
23 | }
|
24 | exports.pathIn = pathIn;
|
25 | //# sourceMappingURL=path-in.js.map |
\ | No newline at end of file |