问题描述
我正在制作一个离子/角度应用程序,通过一次显示一组纸牌来测试内存,而离子5的动画存在问题。当我在浏览器中进行离子投放时,动画效果非常好,卡片出现并消失。当我在执行ng build --prod之后尝试在Firebase托管上运行我的应用程序时,出现奇怪的故障,其中出现了卡,但在切换到下一张卡之前闪烁,有人知道如何解决此问题吗?
这是我的card-span.page.ts中控制动画的代码(currentCardView是@ViewChild,它引用DOM中的元素):
router.get('/person',async (req,res) => {
const person = await Person.find();
person.id = person._id;
delete person._id;
res.send(person);
});
这是我的card-span.service.ts中的代码,用于控制卡的切换:
brighten() {
const brighten = this.animationCtrl.create()
.addElement(this.currentCardView.nativeElement)
.duration(1800)
.iterations(1)
.fromTo('opacity','0','1');
brighten.play()
}
这是我card-span.page.ts中的事件发射器订阅:
runSeries(i) {
this.eventemitter.onForm('disappear')
if (this.paused === true) {
this.pausedi = i
}
else {
if (i < this.level) {
this.currentCard = this.getRandomCard()
this.eventemitter.onCurrentCardRoute(this.currentCard)
// this.animate.emit('fade')
this.eventemitter.onAnimate('brighten')
setTimeout(() => {
i++
this.runSeries(i)
},1900)
} else {
// this.animate.emit('fade')
setTimeout(() => {
this.eventemitter.onForm('reappear')
},600)
}
}
}
最后,这是我的HTML代码,其中包含显示的卡片:
this.eventemitter.animate.subscribe(value => {
if (value === 'brighten') {
this.brighten()
}
})
我对为什么游戏可以在localhost上正常运行但不能在Firebase主机上运行感到非常困惑,这与ng build --prod编译我的代码有什么关系吗?
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)