How to implement the introduction of third-party plug-ins on demand by vue
This article is about how vue implements the on-demand introduction of third-party plug-ins. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.
Third-party plug-ins are introduced on demand
Third-party component libraries such as Element-UI can be introduced on demand to avoid being too large, especially when the project is small, it is not necessary to introduce the component library completely.
/ / main.jsimport Element3 from "plugins/element3"; Vue.use (Element3) / / element3.js// fully introduce import element3 from "element3"; import "element3/lib/theme-chalk/index.css"; / / introduce / / import "element3/lib/theme-chalk/button.css" on demand; /. / / import {/ / ElButton, / / ElRow, / / ElCol, / / ElMain, /. / /} from "element3" Export default function (app) {/ / complete introduction of app.use (element3) / / on-demand introduction of / / app.use (ElButton);} Thank you for reading! This is the end of the article on "how to implement the introduction of third-party plug-ins on demand by vue". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it for more people to see!