deyanivanov966

!!! Vue.js For Beginner Section 1 Installation of Vue JS and how set up a project

Feb 12th, 2022 (edited)
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.98 KB | None | 0 0
  1. ВАЖЕН КЛИП!!!
  2.  
  3. https://www.youtube.com/watch?v=HGs6MvHXh3w
  4.  
  5. --> Installation
  6. To make building Vue applications easier, there is also a Vue CLI to streamline the development process. To use the npm and CLI packages, you will need:
  7.  
  8. Installed Node.js 16.14.0
  9. To install the CLI, run the following command in your terminal:
  10.  
  11. npm install –g @vue/cli
  12.  
  13.  
  14. --> Installation of Vue JS and how set up a project
  15. Initialize a new project
  16. Once the Vue CLI is installed, you can open a terminal in the directory where you want to create the project and run the vue create <project-name> command.
  17.  
  18. After entering the command, the CLI will give you the possible configurations that you can use for the project. There are a few preset ones, but you can make others of your choice yourself. These options allow you to configure things like TypeScript, vue-router, test tools, and more.
  19.  
  20. We will select the Default option (Vue 3). Select the option using the arrow keys and then press Enter.
  21.  
  22.  
  23. --> Installation of Vue JS and how set up a project
  24. Project structure
  25. One of the most important files is package.json. This file contains all the details for your project.
  26.  
  27. -project name
  28. -project version
  29. -public or private project
  30. -scripts
  31. -start server
  32. -build
  33.  
  34. The folder node_modules are packages supported by the dependency. A package is a file or directory that is described by a package.json file. A package must contain a package.json file in order to be published to the npm registry.
  35.  
  36. Public folder contains two files: index.html and favicon.ico
  37.  
  38. -index.html: This is the basic template for your application. Your Vue application will always run from this HTML page
  39.  
  40. SRC folder is the core of your Vue application.
  41.  
  42. -main.js file initialize your Vue application and specifies which HTML element in the index.html file should be attached to your application.
  43. -In this file you register global components or additional Vue libraries.
  44. -App.vue: this is the top level component in your Vue app.
  45. -Assets in this folder are located all css files or images
  46.  
  47.  
  48. --> Installation of Vue JS and how set up a project
  49. Launch the application locally
  50. In your terminal, write the command to start your server: npm run serve
  51.  
  52. Your terminal should display something like the following:
  53.  
  54. 1. INFO Starting development server…
  55. 2. 98% after emitting CopyPlugin
  56. 3. DONE Compiled successfully in 18121ms
  57. 4. App running at:
  58. 5. – Local: <http://localhost:8080/>
  59. 6. – Network: <http://192.168.1.9:8080/>
  60. 7. Note that the development build is not optimized.
  61. 8. To create a production build, run npm run build.
  62.  
  63. Open your browser and enter one of the following addresses:
  64.  
  65. 1. – Local: <http://localhost:8080/>
  66. 2. – Network: <http://192.168.1.9:8080/>
  67.  
  68.  
  69. --> Installation of Vue JS and how set up a project
  70. Make first changes
  71. Let’s make our first change to the app:
  72. Above the code ( <HelloWorld msg=“Welcome to Your Vue.js App“/> ) , add the following line:
  73. <h2>This is my first Vue app</h2>
Add Comment
Please, Sign In to add comment