Why is the method of locating dom using refs repeated?

use ref to locate dom, because it is located in a DOM node with v-if and v-for, so it is called in updated. After printing it, it is found that it will be called seven times, which may be due to the update of updated. Currently, there is no method to control the execution only once. The code for help ~
is as follows:
/ / get the product code and merchant code

        getGoods : function () {
            for(let i=0;i<this.$refs.goods.length;iPP) {
                app.goodsData = Object.assign({}, app.goodsData, {
                    sugGoodsCode: this.$refs.goods[i].dataset.procode,
                    shopCode: this.$refs.goods[i].dataset.vender  //data-procodedata-vender
                })
                app.goodsList.push(app.goodsData);
            }
        }
       

call in updated:
updated: function () {

        this.getGoods();
    }
    

print in the background, there is no problem with the data, but there is a problem of repeated execution:

Dec.27,2021

  1. try shaking? Refer to lodash.debounce
  2. can you adjust it in mounted
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3c673-2c329.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3c673-2c329.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?