PeachScript / vue-infinite-loading

An infinite scroll plugin for Vue.js.
https://peachscript.github.io/vue-infinite-loading/
MIT License
2.66k stars 366 forks source link

fix: PluginFunction type is not assignable to type options #267

Closed serialine closed 4 years ago

serialine commented 4 years ago

How to reproduce

app.ts

Vue.use(InfiniteLoading, {
    slots: {
        noMore: '',
        error: '',
    },
});

TypeScript terminal

No overload matches this call.
  Overload 2 of 2, '(plugin: PluginObject<any> | PluginFunction<any>, ...options: any[]): VueConstructor<Vue>', gave the following error.
    Argument of type 'typeof InfiniteLoading' is not assignable to parameter of type 'PluginObject<any> | PluginFunction<any>'.
      Type 'typeof InfiniteLoading' is not assignable to type 'PluginObject<any>'.
        Types of property 'install' are incompatible.
          Type 'PluginFunction<never>' is not assignable to type 'PluginFunction<any>'.
            Type 'any' is not assignable to type 'never'.

How to fix

codecov[bot] commented 4 years ago

Codecov Report

Merging #267 into master will not change coverage. The diff coverage is n/a.

Impacted file tree graph

@@          Coverage Diff          @@
##           master   #267   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files           5      5           
  Lines         174    174           
  Branches       32     32           
=====================================
  Hits          174    174

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 3792d95...562f646. Read the comment docs.

ArthasEclat commented 4 years ago

@PeachScript , I also stumbled upon it. Can you, please, merge this PR?

PeachScript commented 4 years ago

@ArthasEclat of course yes :D

serialine commented 4 years ago

@PeachScript : Can you publish latest release with merged this to registry? I think its not published npm registry yet

agentschmitt commented 4 years ago

@PeachScript I have the same problem when using options for the plugin. Could you please release a new npm package, as the bug is already fixed with the PR. :)

unachang113 commented 4 years ago

@PeachScript I have the same problem too. Could you please publish npm registry?

PeachScript commented 4 years ago

@unachang113 sorry for late, v2.4.5 released