收藏
回答

组件调用全局@keyframes失效的问题?

全局动画

app.wxss

@keyframes example {

  0% { background-color: red; }

  100% { background-color: yellow; }

}

.animation-example {

  animation: example 5s infinite;

}

组件页面

register.json

{

  "component": true,

  "usingComponents": {},

  "componentFramework": "glass-easel",

  "renderer": "skyline",

  "styleIsolation": "apply-shared"

}

register.wxml

<view class="animation-example">这里的视图将应用动画</view>

这个动画不生效,将全局keyframe移动到register.wxss就可以生效了,全局class没有问题

最后一次编辑于  2024-08-01
回答关注问题邀请回答
收藏
登录 后发表内容