создать метод prices.js в конструкторе Laravel
Всем привет, нужно создать метод чтобы вывести все цены стоимости продуктов код Vue
<tr @click="selectQty(record)" v-for="(record, idx) in records" :key="record.id">
<td>
<label class="custom-checkbox">
<input :checked="record.qty == $prices.quantity" type=checkbox>
<span class="custom-label"></span>
</label>
</td>
<!-- <tr v-for="(record, idx) of records" :key="record.id"></tr>-->
<td>{{ record.qty }}</td>
<td>{{$prices.getQtyPrice() | toCurrency('netto')}}</td>
<td>{{$prices.getQtyPrice() | toCurrency}}</td>
</tr>
код script
export default {
props: {
product: {
required: true,
type: Object
}
},
computed:{
records(){
var step = (this.product.order_step)? this.product.order_step : 10;
var array = [];
for(var i = 1; i <=10; i++){
array.push({
qty: step * i
})
}
return array;
}
},
mounted(){
console.log(this.product);
},
methods:{
selectQty(record){
this.$prices.quantity = record.qty;
}
}
}
мне надо вывести эти все цены в prices.js
methods:{
getQtyPrice() {
?
},
Сейчас это работает так что по клике показывает цены и только потом они показываюся, мне нужно чтобы они цены были видимимы сразу