The vue3.0 project is built using vue-cli

The vue3.0 project is built using vue-cli

Tell me about your recent learning

Recently, I have been in a hurry to learn something and solve some problems. I can see through the problem. I saw a lot of posts sharing the content and tried it on my own problem to solve it. Later, I reflected that it couldn't be like this.
1. The knowledge has not improved.
2. I don’t know where to start when encountering problems
.

After thinking about it, when encountering a problem, we must try our best to find the basis and the root of the problem so that we can solve the problem fundamentally when we encounter it in the future. The important point is to find the API documentation to understand it in depth. (Do you guys have the same feelings as me!!!)

start building

vue-cli API location: https://cli.vuejs.org/zh/guide/installation.html

insert image description here

Install

First, see if you have installed vue-cli. It will appear to indicate that you have installed it.
vue --version

insert image description here

After the installation command is installed, check whether the installation is successful, or the above steps.
npm install -g @vue/cli
# OR
yarn global add @vue/cli
Create a project hello-world is the project name will automatically create a project folder
vue create hello-world

We use our own choice of configuration, select up and down, press Enter,
insert image description here
select the component you want, and select cancel. Generally, we need router and vuex. We choose to
insert image description hereinsert image description here
select the version of vue version,
insert image description here
and select the mode of vue-router.
There are two modes of vue-router (front-end routing), Hash mode and history mode, here are the differences between the two.

Hash refers to the # after the tail of the url and the following characters. History has no bottom band #, which looks better than the hash mode. The
difference in principle (principle)
hash is compatible to IE8, and history is only compatible to IE10;
due to changes in the hash value It will not cause the browser to send a request to the server, and the hash change will trigger the hashchange event (hashchange can only change the url fragment after #); although the hash path appears in the URL, it will not appear in the HTTP request, completely affecting the backend It has no effect, so changing the hash value will not reload the page, basically using hash to implement front-end routing.

insert image description here
Select the ESLint syntax detection configuration
insert image description here
and press Enter to indicate when to use ESLint. Here, you can choose to save, which is the default. As shown below.
insert image description here
After pressing Enter, the next option is configured in the configuration file or in the package.json file. Here, choose to configure the alias in the configuration file
insert image description here
and press Enter to start creating the project.
insert image description here
The project is created successfully.
insert image description here
The error reported after creating the project is actually a syntax detection error.
insert image description here

insert image description here

In fact, look at the api after finishing it, but the api documentation is not so detailed. According to the api, everyone should be able to complete it independently, but it's just a matter of efficiency. I still hope that everyone will try to complete it according to the api like me.

Later, I will write a multi-environment configuration post (according to the api). I hope you can read more about api development so that you can understand it more clearly, and you can actually operate it yourself, otherwise you won’t be impressed at all. I hope you can correct me if I write something wrong. Come on. Friends. Give me a like if you find it useful!

Guess you like

Origin blog.csdn.net/shixiaodongmain/article/details/125190475