我可以使本机脚本$ navigate退还诺言吗?

时间:2019-10-17 06:21:01

标签: nativescript nativescript-vue

这是我处理OTP提交的方法:

      submitOTP() {
        const loader = new LoadingIndicator();
        loader.show({
          message: 'Verifying your response...',
          dimBackground: true,
          userInteractionEnabled: false, // default true. Set false so that the touches will fall through it.
          hideBezel: true, // default false, can hide the surrounding bezel
          mode: Mode.Indeterminate, // see options below
        });
        this.$store
          .dispatch('submitOTP', this.otp)
          .then(stt => {
            if (stt == 'signed up') {
              this.$navigateTo(RegistrationForm, {clearHistory: true});
            } else if (stt == 'signed in') {
              this.$navigateTo(Home, {clearHistory: true});
            }
            loader.hide();
          })
          .catch(e => {
            console.log(e);
            loader.hide();
          });
      },

这里的问题是加载指示器被隐藏,并且在一秒钟之后才被加载,然后新页面被加载。我想知道我是否可以做这样的事情:

this.$navigateTo(Home, {clearHistory: true}).then(loader.hide())

0 个答案:

没有答案