vue element.ui custom table, the prices in multiple input in a row of data are automatically added to calculate the total price
as shown in the figure:
vue element.ui custom table, the prices in multiple input in a row of data are automatically added to calculate the total price
as shown in the figure:
. The result of the total price should be the calculated value, not a separate field.
either remove the field of the total price and change it to a calculation attribute, or
listen for changes in the data of other input boxes, and manually modify the value of the total price
// html
<input v-model="scope.row.time" type="text" class="plan-input" style="width: 50px"> = {{calculateTotal(scope.row)}}
// js
methods: {
//
delete_offer:function(index){
vm.offer.splice(index,1)
},
calculateTotal: function (row) {
row.total_price = row.price * row.number * row.time
return row.total_price
}
}
suggestion : a single component to achieve the added function
when I was creating the exam. The start time can be earlier or later than the current time, but if the start time is later than the end time, I should prompt "the start time cannot be later than the end time ". If the start time is earlier than the curr...
I am a diglog pop-up window, in which the form needs to be verified, but there are three items of input phone, mailbox, landline. You can fill in only one of these three items. How to write verification rules. the concrete picture is shown below. I...
the problem encountered now: in a form, there are An and B select drop-down boxes. When A drop-down box contains a specific value, B drop-down box is required, otherwise it is optional. I tried to write this in rules: rules:{ overseasSt...
using proxyTable can only write all domain names in index.js, how to dynamically change the domain name of the interface? ...
the main problem is that I can t eliminate the blank at the beginning of this broadcast image. When the image data is obtained from api, it is obtained using axios in created. Finally, it causes the phenomenon of blank in the front paragraph. I ha...