this.$nextTick 将回调延迟到下次DOM更新循环之后执行。在修改数据之后立即使用它,然后等待DOM更新。

this.$nextTick(() => {
            if (this.allPix.length > 0) {
              this.rechargeList.unshift({
                name: this.$t("PIX"),
                uname: "pix",
                img: require("../assets/images/bankcard.svg"),
                depositType: 3
              });
              this.depositType = 3;
            }
            if (this.allWallet.length > 0) {
              this.rechargeList.unshift({
                name: this.$t("电子钱包"),
                uname: "wallet",
                img: require("../assets/images/bankcard.svg"),
                depositType: 2
              });
              this.depositType = 2;
            }
            if (this.allBank.length > 0) {
              this.rechargeList.unshift({
                name: this.$t("银行卡"),
                uname: "bank",
                img: require("../assets/images/bankcard.svg"),
                depositType: 0
              });
              this.depositType = 0;
            }
            if (this.allUsdt.length > 0) {
              this.rechargeList.unshift({
                name: this.$t("USDT"),
                uname: "usdt",
                img: require("../assets/images/usdt.svg"),
                depositType: 1
              });
              this.depositType = 1;
            }
            if (this.rechargeList.length > 0) {
              this.rechargeListChange(this.rechargeList[0].name);
            }
            this.currency_defa = res.data.data.currency_defa; //货币类型
          });

By lxcss

发表评论

您的电子邮箱地址不会被公开。 必填项已用*标注