Write the NPM package, you introduce a third-party library type, and when you install the package in your project and use it, the type does not match?

Viewed 25

Does a third-party library type not match when you write an NPM package?

I wrote an NPM package by myself because it needs to use two types of Vue-router, so it is introduced

Import types

1

After the package is published to NPM and installed through PNPM I, it is found that the type of the vue-Router in the package does not match the type of the Vue-Router in the current project

This is because the version of the package vue-Router is different from that of the current project vue-Router.

ts error msg

2

'类型不兼容' means 'Type incompatible'

I want to use the two types of vue-router in the package. May I ask if you have a better way to deal with the type of vue-router introduced when I wrote the package?

0 Answers
Related