A
A
Andrej Sharapov2019-08-27 15:00:03
Vue.js
Andrej Sharapov, 2019-08-27 15:00:03

How to withdraw the total amount?

Threw a calculator into the sandbox

Can you tell me how to display the total amount in the block?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey, 2019-08-27
@Madeas

Remove subTotal from data,
add computed prop

computed: {
    subTotal() {
      return this.pricelist.reduce((acc, item) => {
        return acc + item.price*1
      }, 0)
    } 
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question