Al usar fotogramas clave, se encontraron los siguientes problemas en los módulos css:
Código CSS original:
<strong i="7">@keyframes</strong> rotating {
0% {
transform: rotate(0);
}
100% {
transform: rotate(360deg);
}
}
.rotating-item {
animation: 5s linear 0 infinite rotating;
}
Compilado en el siguiente código:
@-webkit-keyframes rotating___3vsQl {
0% {
-webkit-transform: rotate(0);
transform: rotate(0);
}
100% {
-webkit-transform: rotate(360deg);
transform: rotate(360deg);
}
}
<strong i="11">@keyframes</strong> rotating___3vsQl {
0% {
-webkit-transform: rotate(0);
transform: rotate(0);
}
100% {
-webkit-transform: rotate(360deg);
transform: rotate(360deg);
}
}
.rotating-item___3pALh {
-webkit-animation: 5s linear 0 infinite :local(rotating);
animation: 5s linear 0 infinite :local(rotating);
}
Creo que el correcto debería ser:
@-webkit-keyframes rotating___3vsQl {
0% {
-webkit-transform: rotate(0);
transform: rotate(0);
}
100% {
-webkit-transform: rotate(360deg);
transform: rotate(360deg);
}
}
<strong i="15">@keyframes</strong> rotating___3vsQl {
0% {
-webkit-transform: rotate(0);
transform: rotate(0);
}
100% {
-webkit-transform: rotate(360deg);
transform: rotate(360deg);
}
}
.rotating-item___3pALh {
-webkit-animation: 5s linear 0 infinite rotating___3vsQl;
animation: 5s linear 0 infinite rotating___3vsQl;
}
No sé si es un error de los módulos css o un problema de configuración en el paquete web.
Nota:
- El proyecto creado con dva-cli no modificó la configuración del paquete web.
- Lo escribí en menos al principio, pero no funcionó si lo cambié a css.
En el caso de menos escritura, indique
<strong i="25">@keyframes</strong> :global(rotating)
reportará un errorLas versiones de la herramienta son las siguientes:
nodo. [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
https://github.com/css-modules/css-modules/issues/141#issuecomment -243011699
¿Puede esto resolver tu problema?
¡Gracias 🙏!
Sí, esto está bien, pero encontré que el problema es
animation: name .6s ease; // 这样是可以的
animation: .6s ease name; // 而这样就不会被识别到了
Fue criticado por la documentación de mozilla😂
<single-animation> = <time> || <single-timing-function> || <time> || <single-animation-iteration-count> || <single- animation-direction> || <single-animation-fill-mode> || <single-animation-play-state> || [ none | <keyframes-name> ] /* <strong i="11">@keyframes</strong> duration | timing-function | delay | iteration-count | direction | fill-mode | play-state | name */ animation: 3s ease-in 1s 2 reverse both paused slidein; /* <strong i="12">@keyframes</strong> duration | timing-function | delay | name */ animation: 3s linear 1s slidein; /* <strong i="13">@keyframes</strong> duration | name */ animation: 3s slidein;
Comentario más útil
¡Gracias 🙏!
Sí, esto está bien, pero encontré que el problema es
Fue criticado por la documentación de mozilla😂