0
点赞
收藏
分享

微信扫一扫

9秒定时器使用

雪域迷影 2022-10-24 阅读 178

    getStock() {

      let t = 0;

      const timeOut = () => {

        //9秒定时器

        setTimeout(() => {

          this.$store.dispatch("HOME_STOCK", {}).then(() => {

            t = t || 9 * 1000;

            timeOut();

          });

        }, t);

      };

      timeOut();

    },



  // getStock() {

    //   let t = 0;

    //   const timeOut = () => {

    //     //9秒定时器

    //     setTimeout(() => {

    //       this.$store.dispatch("HOME_STOCK", {}).then(() => {

    //         t = t || 9 * 1000;

    //         timeOut();

    //       });

    //     }, t);

    //   };

    //   timeOut();

    // },


举报

相关推荐

0 条评论