What are the solutions for front-end (vue-based) cross-project component reuse?

the front end is developed in parallel with multiple projects based on vue2.0,. How can components be shared among multiple projects?
Please consider the convenience, maintainability, security and extensibility of development.
for example, the following scenario:
1, when the reused component is updated, the dependent party can update painlessly.
2. When there are new reusable components, it can be easily extended.
3. The component code does not want to be published to the external network, but is only used within the local area network.

that"s all I can think of right now. I hope you can help me and give me some ideas

Jun.09,2021

extract reusable components to form a common component library, publish them to npm for centralized management, and introduce them to multiple projects. When the component is updated, the relying party can update the package version directly.


encapsulate the common components that may be used in multiple projects, write them into vue plug-ins, and then manage them through npm, so that when such common components are used in other projects, you can install them directly with npm.

Menu