Аргумент типа «click» не может быть назначен параметру типа TypeEventHandlers - PullRequest
0 голосов
/ 06 апреля 2020
$(document).on('click', '#focal-toggle', function(this: HTMLElement | HTMLElement[], e:MouseEvent) {
No overload matches this call.
  The last overload gave the following error.
    Argument of type '"click"' is not assignable to parameter of type 'TypeEventHandlers<Document, (this: HTMLElement | HTMLElement[], e: MouseEvent) => void, Document, Document>'.
{
    "resource": "/root/dev/work/OutrunInteractive2020/webfocusview/plain/ts/webfocusview.ts",
    "owner": "typescript",
    "code": "2769",
    "severity": 8,
    "message": "No overload matches this call.\n  The last overload gave the following error.\n    Argument of type '\"click\"' is not assignable to parameter of type 'TypeEventHandlers<Document, (this: HTMLElement | HTMLElement[], e: MouseEvent) => void, Document, Document>'.",
    "source": "ts",
    "startLineNumber": 58,
    "startColumn": 18,
    "endLineNumber": 58,
    "endColumn": 25,
    "relatedInformation": [
        {
            "startLineNumber": 7957,
            "startColumn": 5,
            "endLineNumber": 7961,
            "endColumn": 13,
            "message": "The last overload is declared here.",
            "resource": "/root/dev/work/OutrunInteractive2020/webfocusview/plain/node_modules/@types/jquery/JQuery.d.ts"
        }
    ]
}

Я не могу использовать обработчик on с машинописью. Как это решить?

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...