TypeError: Assignment to constant variable

This question depends on your understanding of const, look at the source code

 for (const key in data) {
     const val = data[key];
     if (this.multipleVale === false) {
         val = [val];
     }
     val.forEach((i, x) => {
         fd.append(`style_id[${x}]`, i);
     });
}

Reason for the error: const defines val and has an initial value. Next, a value is assigned to val, so an error is reported.

Just change const val to let val

Guess you like

Origin blog.csdn.net/m0_61672533/article/details/128615732