rigor789/vue-scrollto

using this.$scrollTo in nuxt / typescript

开放

#321 创建于 2020年7月11日

 (2 条评论) (4 个反应) (0 位负责人)JavaScript (114 个派生)batch import
help wantednuxt

仓库指标

星标
 (1,966 个星标)
PR 合并指标
 (30 天内没有已合并 PR)

描述

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)"

贡献者指南