element-----------打印的数据
想把每一条数据的specItems的image赋值给specItem,但是现在页面上的dom没有更新,需要再次点击,求详细解释,这里的$set应该怎么写
// 表格插入图片
createImgsObj() {
this.$forceUpdate();
let imgsObj = {}
let tableCategoryList = this.tableCategoryList
// 循环规格值的数组
for (let index = 0; index < tableCategoryList.length; index++) {
const element = tableCategoryList[index]
console.log(element,'element-----------');
if (element.specItems.length > 0) {
let specItems = element.specItems
console.log(specItems,'specitems===========')
for (let i = 0; i < specItems.length; i++) {
const tempArray = specItems[i]
console.log(tempArray,'jjj')
console.log(tempArray.specItem,'k==================v')
// imgsObj[tempArray.specItem] = tempArray.image;
// imgsObj[tempArray.specItem] = tempArray.image; 把tempArray里面的imgage给到this.imgsObj tempArray里面的specItem
this.$set(imgsObj,'specItem',tempArray.image)
// imgsObj[tempArray.specItem] = 'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg'