TL; DR
- Install cli3 command line
npm install -g @vue/cli
- Install preview a single Vue file
npm install -g @vue/cli-service-global
- Highly recommended
vue ui
Import existing projects or create new projects, install plugins, configure ESLint rules, etc - Save automatically uniform code style, really cool
- The custom parameters of the personal generated project are the same here with the UI view
vue create hello-vue
# Select this
> Manually select feature
# Shame I can't ts yet◉ Babel Infection infection TypeScript infection Progressive Web App (PWA) Support ◉ Router ◉ Vuex ❯◉ CSS pre-processors nut Linter/Formatter# do not select the history mode, this is only a project, MY side hash enough
? Use history mode for router? (Requires proper server setup for index fallback in production) (Y/n) n
# Dart is faster, others are optional❯ Sass/SCSS (with dart - Sass)# add prettier, automatically formatting HTML and CSS in VUE when saving
❯ ESLint + Prettier
# save will automatically lint, commit will be too much❯ ◉ Lint on saveGenerate configuration files separately, at a glance
❯ In dedicated config files
# save configuration
Save this as a preset for future projects? y
Copy the code
- My level is limited, only for reference
Install cli3
node -v
- If the value is lower than 8.9.0,, yes
npm install -g n
andn stable
Update Node to the latest stable version, which may be required under MACsudo
- If an error is reported, the node is not installed
vue --version
- Execute if version 3 is not available
npm uninstall vue-cli -g
- If an error occurs, install cli3 directly
npm install -g @vue/cli
Again,vue --version
Under the,
The CLI previews a single Vue file
npm install -g @vue/cli-service-global
- Go to any folder and create one
App.vue
Of course, there can be other files in the folder, this file is only the startup file vue serve App.vue
Node_module will be generated in the folder and the page can be accessed in the browservue build App.vue
The dist folder is generated in the folder and can be deployed
Used to develop a library, components, do some small demo is very suitable!
Command line to create a new project
vue create hello-vue
Hello-vue is the name of the folder. If it does not exist, the folder will be created automatically. If it does exist, it will be installed in that folder.- The selection template is displayed. Press up or down to select the template
- Default, the default configuration, meaning only Babel and esLint. After selecting this option, create the project directly
- Manually select feature: Manually configuration
- After manual setting, if you save the configuration, there will be multiple options next time
- Select the configuration
The blank space key
Check/reverse check,Press a key
All/none,Press the I key
Reverse selection of selected items, up and down key to move up and down selection. You can configure different functions depending on the size of the project and the functional experience- The selected
router
When, pay attention!! In qUse history mode for router?
Suggest to choosen
The history mode requires some cooperation from the server and can be turned on again if needed later - The selected
CSS preprocessor
If sASS is selected, you are advised to select sASSSass/SCSS (with dart-sass)
- The selected
lint/formatter
(support code style check and formatting), personal preferenceeslint+prettier
.What the Standard specification is.airbnb In dedicated config files
The configuration for Babel, postCSS, and ESLint are all separate files. This one is generally chosenSave this as a preset for future projects? (Y/n)
// Do you want to record the configuration so that you can continue using it next time? Enter the name of the configuration if necessary
npm run serve
Open your browser and take a look
Creating and managing projects graphically is highly recommended
This article is awesome
The following can not see, not as good as the above, ha ha ha
vue ui
Run this command in the folder where you want to build the project, and then look at the dots
- Enter the project dashboard
- To set the Quick start item => Click Custom in the upper right corner => Select Run Task => Select Finish => Click Configure Component
- Task => Serve => Variables => Specific configurations such as configurable ports, environment variables, and HTTPS enable. Other tasks can also be configured using variables
- Configuration side, such as setting deployment path, output directory and so on, Eslint rule changes
- To install dependencies, be careful whether to develop or run them
- Installing a plug-in
Vuecli uses ultra detailed vuecli