2017-01-26 00:30:09 +03:00
|
|
|
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;
|
|
|
|
}
|
2017-03-16 23:27:20 +03:00
|
|
|
|
|
|
|
@action.bound setPrice(price) {
|
|
|
|
this.price = price;
|
|
|
|
}
|
2017-01-26 00:30:09 +03:00
|
|
|
}
|