props: ['item'],computed: {
coinPrice () { return this.item.currentPrice.toFixed(2)
}
}這里報(bào)this.item.currentPrice undefined,查了加載順訊,props在computed之前,為什么會(huì)報(bào)undefined?值可以出來,先報(bào)undefined后在出來
1 回答

泛舟湖上清波郎朗
TA貢獻(xiàn)1818條經(jīng)驗(yàn) 獲得超3個(gè)贊
that result from data request is async,so occur undefined error in first time render
添加回答
舉報(bào)
0/150
提交
取消