rigor789/vue-scrollto

using this.$scrollTo in nuxt / typescript

Open

#321 aberto em 11 de jul. de 2020

Ver no GitHub
 (2 comments) (4 reactions) (0 assignees)JavaScript (1.966 stars) (114 forks)batch import
help wantednuxt

Description

There's an issue when using with nuxt (2.13.3) / typescript (@nuxt/types => 2.13.3)

If i don't import vue-scrollto inside my global.d.ts file:

import 'vue-scrollto'

Then using this.$scrollTo inside a component would complain about:

"Property '$scrollTo' does not exist on type 'CombinedVueInstance<Vue, Data, { setActive(index: number, id: number): void; findArticles: ((this: any, val: string) => Promise) & Cancelable; hideResults(): void; showArticle(articleId: number, categoryId: number): Promise<...>; }, unknown, Readonly<...>>'.Vetur(2339)"

Guia do colaborador