2018-06-16T07:44:46Z||2018-06-16T07:44:46Z


通过web-animations-js来给SVG的fill加动画:

const animation = element.animate({
      fill: 'red',
    }, 800);

报错:

DOMException: Failed to execute 'animate' on 'Element': Partial keyframes are not supported

是因为没有设置动画的初始值,这样就好了:

const animation = element.animate({
      fill: ['green', 'red'],
    }, 800);