source:[
{
anim: wx.createAnimation({
duration: 400,
timingFunction: 'ease'
}).translateY(10).opacity(1).scaleX(1).step().export()
},{
anim: wx.createAnimation({
duration: 400,
timingFunction: 'ease'
}).translateY(10).opacity(1).scaleX(1).step().export()
},{
anim: wx.createAnimation({
duration: 400,
timingFunction: 'ease'
}).translateY(10).opacity(1).scaleX(1).step().export()
},{
anim: wx.createAnimation({
duration: 400,
timingFunction: 'ease'
}).translateY(10).opacity(1).scaleX(1).step().export()
},
]
<template name="teml">
<view animation="{{anim}}" > // 這里的動畫不會執(zhí)行
循環(huán)時,模板中引用的動畫不會執(zhí)行
</view>
</template>
<block wx:for="{{source}}" wx:key="item">
<template is="teml" data="{{...item}}" />
</block>
網(wǎng)友回復(fù):
把 data="{{...teml}}"中的 teml 換成 anim 可以執(zhí)行嗎?
額對不起 我問題中的代碼有誤
樓主你好,你的這個動畫循環(huán)成功了嗎?我現(xiàn)在寫也遇到了問題,就是只會放一次,并不會循環(huán)多次,最后樓主是怎么解決的呢,能不能把代碼提交看一下,謝謝了
沒有解決,我覺得這是小程序的 bug 他在設(shè)計(jì)的時候沒有按照 css3 動畫來設(shè)計(jì)所以用的時候也不能按照 css3動畫來 用