vue1 - vue introduction method, local installation NPM

Blog address: https://www.cnblogs.com/sandraryan/

Vue.js (pronunciation / vjuː /, similar to the view) is a progressive frame constructing user interfaces. Vue only concerned view layer, a bottom-up design incremental development.

vue to use:

1. official website to download directly introduced into the js file

2. cdn <script src = "https://cdn.bootcss.com/vue/2.6.10/vue.js"> </ script> (I use this)

3. asl 

To use npm, first of all should go to the official website to download node node, downloaded node will contain npm tool, you can enter the terminal node -v / npm -v view node / npm whether the installation is successful

npm i npm -g update / install npm

Then, NPM VUE I (I is the abbreviation of install)

Detecting whether the download is successful vue, vue -V (Note: uppercase V)

CLI-mounted global VUE   NPM the install - Global VUE - CLI (Global abbreviated g)

Use webpack packaged tool to generate a file directory (initialization vue project)   vue webpack the init folder

Enter the generated files (command cd folder name), run vue page: npm RUN dev

Successful operation the terminal will return a URL, in general, the port number is 8080, opened in a browser, it is your mess vue project

Supplementary: NPM is accompanied NodeJS package management tools installed together, we can solve many problems on the deployment of code NodeJS

    Command Line Interface (English: command-line interface, abbreviation: CLI )

    webpack is an open source front-end packaging tools. Webpack provides a modular development approach is the lack of front-end development, all kinds of static resources as a module, and optimized code generated from it. You must install before you want to use Node.js Webpack, use webpack directory will be automatically generated in vue

If you just write your own demo I generally use cdn introduced, but to carry out large-scale development projects, usually with npm

Installation Routing

vue selected at the time of installation yes, you can download the route, if elected no, the latter can also install your own (do not write configuration Benpian QAQ)

npm i vue-router --save

Installation vue-x

Vuex is a specially developed for Vue.js application state management

Vuex generally only installed in the current project

npm i vuex --save

tha't all ~~~~

Guess you like

Origin www.cnblogs.com/sandraryan/p/11976888.html