1
在我的Laravel 5.4模型之一,我有多個訪問器。就像這樣:Laravel通過accessor vue
public function getRevenueAttribute()
{
return $this->calculate()->revenue($this->price, $this->amount);
}
的問題是,當我的模型傳遞給我的VUE組件:
<product :prp-product="{{json_encode($product)}}"></product>
product.revenue
不存在。有沒有辦法做到這一點?我不想再次用vue來計算這些東西。
非常感謝。