15 lines
249 B
JavaScript
15 lines
249 B
JavaScript
![]() |
import {observable} from "mobx";
|
||
|
|
||
|
@observer class OrderLine {
|
||
|
@observable price:number = 0;
|
||
|
@observable amount:number = 1;
|
||
|
|
||
|
constructor(price) {
|
||
|
this.price = price;
|
||
|
}
|
||
|
|
||
|
@computed get total() {
|
||
|
return this.price * this.amount;
|
||
|
}
|
||
|
}
|