计算属性的复杂操作

计算书的价格并输出

一法:

但是过于繁琐

使用计算属性,for循环计算书的总价

总价格:{{totalPrice}}

 es6的语法

        for(let i in this.books){}
        for(let book of this.books){}

你可能感兴趣的:(vue学习,vue.js,前端,html)