改改名
天下事有难易乎?为之,则难者亦易矣;不为,则易者亦难矣。

JS常见问题汇总

vue.min.js:6 Uncaught TypeError: Assignment to constant variable.

const定义的常量不能被修改

                const priceTotal = 0
                const prudctCount = 0
                this.package1.forEach(element => {
                    console.log(element,'===element')
                    priceTotal += element.price
                    // prudctCount += element.count
                });
修改为 var