• 原因:api对象调用时需放到函数里面进行调用。
  • 例如
self.login = function () {
// 参数是否为空
    if (!self.phone() && !self.code()) {
        $api.toast('手机号或验证码为空');
        return false;
        }
        api.toast({
            msg: 'hello'
        });
    }
  • 此时调用就不会报错。

相关文章:

  • 2022-12-23
  • 2021-04-24
  • 2021-03-26
  • 2021-05-26
  • 2021-11-24
  • 2021-10-26
  • 2021-10-30
  • 2021-07-11
猜你喜欢
  • 2021-10-07
  • 2022-12-23
  • 2021-07-22
  • 2022-02-26
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案