RiotJS Uncaught TypeError: attrName.replace не является функцией - PullRequest
0 голосов
/ 04 декабря 2018

Я использую пакет RiotJS 3.13.2, установленный с npm.В моем коде, когда я использую self.update (), он напечатает консольную ошибку из riot.js: 1660.Похоже, он взят из файла поставщика RiotJS.Это не оставляет никакой подсказки, чтобы отладить это.Пожалуйста, найдите этот скриншот ошибки консоли. снимок экрана с консольной ошибкой

В нем упоминается одна из моих собственных функций, называемая self.nextQuestion (), но она выглядит хорошо и никаких видимых ошибок.Это моя функция self.nextQuestion (): -

self.nextQuestion = function() {
  if (self.currentQuestionNumber < self.totalQuestionCount) {
    self.currentQuestionIndex++;
    self.currentQuestionNumber++;

    if (
      !self.questionList[self.currentQuestionDifficulty][
        self.currentQuestionIndex
      ]
    ) {
      self.currentQuestionIndex = 0;
      if (self.currentQuestionDifficulty === "soft") {
        self.currentQuestionDifficulty = "hard";
      } else {
        self.currentQuestionDifficulty = "soft";
      }
    }

    self.currentQuestion =
      self.questionList[self.currentQuestionDifficulty][
        self.currentQuestionIndex
      ];
    self.currentQuestionType =
      self.questionList[self.currentQuestionDifficulty][
        self.currentQuestionIndex
      ].questionTypeId;
    self.prepareInjectAttr();
    console.log("component attr: ", self.componentAttr);
    self.update();
  } else {
    alert("End of the level!");
  }

  self.hideResponseModal();
  $(".bt-game-box").show();
};

Любая помощь более чем принята.Спасибо.

...