Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

412
Visualizações
VueJS + quasar + TypeScript Can't call this.$router.push()

I am trying to route to another page within a function within in a component. I can't call this.$router.push() and get the following errors:

Compiled with problems:X

ERROR in src/components/ButtonList.vue:118:16

TS2339: Property '$router' does not exist on type 'RenderFunction | { showLoading(): void; todoCount: ComputedRef<number>; clickCount: Ref<number>; increment: () => number; } | Promise<{ showLoading(): void; todoCount: ComputedRef<...>; clickCount: Ref<...>; increment: () => number; }>'.
  Property '$router' does not exist on type 'RenderFunction'.
    116 |           $q.loading.hide();
    117 |           timer = void 0;
  > 118 |           this.$router.push('step-02');
        |                ^^^^^^^
    119 |         }, 2000);
    120 |       },
    121 |     };


ERROR in src/components/ButtonList.vue:118:11

@typescript-eslint/no-unsafe-member-access: Unsafe member access .push on an `any` value.
    116 |           $q.loading.hide();
    117 |           timer = void 0;
  > 118 |           this.$router.push('step-02');
        |           ^^^^^^^^^^^^^^^^^
    119 |         }, 2000);
    120 |       },
    121 |     };


ERROR in src/components/ButtonList.vue:118:11

@typescript-eslint/no-unsafe-call: Unsafe call of an `any` typed value.
    116 |           $q.loading.hide();
    117 |           timer = void 0;
  > 118 |           this.$router.push('step-02');
        |           ^^^^^^^^^^^^^^^^^
    119 |         }, 2000);
    120 |       },
    121 |     };


Any ideas how to fix this? I got a button which should route to the next page after a delay - therefore the setTimeout function.

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda