In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-04 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article mainly introduces the differences between the direct introduction of vue and npm, which has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let the editor take you to understand it.
Vue direct introduction and npm differences: 1, the use of npm to install Vue can facilitate package management, you can directly use Vue commands, will use webpack tools to create projects, front-end build tools will make front-end development more efficient; 2, direct introduction, when the application needs more and more front-end libraries and front-end framework, one by one in the HTML file will be very inconvenient.
The operating environment of this tutorial: windows7 system, vue2.9.6 version, DELL G3 computer.
There are two ways to use vue: direct vue.js and npm installation in HTML.
1. Quote vue.js directly in HTML
You can directly use script to import vue.js files. Vue.js files can be downloaded directly on the official website, or you can use CDN.
Download address on the official website: https://vuejs.org/js/vue.min.js
CDN address:
Https://cdn.staticfile.org/vue/2.2.2/vue.min.jshttps://unpkg.com/vue/dist/vue.js, will remain consistent with the latest version released by npm. Https://cdnjs.cloudflare.com/ajax/libs/vue/2.1.8/vue.min.js
2. Use npm to install
It is recommended to read "how to install vue.js with npm?" "
So what's the difference between introducing vue.js and npm installation directly in HTML? Now I would like to introduce to you.
There is no difference between simply downloading script references and npm downloads. You can also introduce script after npm downloads.
The point is that npm is a tool for package dependency management, which, as you can see, is the recommended download method for use with other packages. When developing, you can use modular solutions such as require ('vue'), import (' vue'), and you can use vue-cli to start a project experience.
Installing Vue using npm facilitates package management. When applications need more and more front-end libraries and front-end frameworks, it will be inconvenient to introduce them into HTML files one by one.
The npm way can directly use the Vue command, will use webpack tools to create projects, front-end build tools will make front-end development more efficient.
Thank you for reading this article carefully. I hope the article "what is the difference between the direct introduction of vue and npm" shared by the editor will be helpful to you. At the same time, I also hope you will support us and pay attention to the industry information channel. More related knowledge is waiting for you to learn!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.