Create an empty vue project, configuration and steps

Check the required environment and plug-in version

create vue command

default allocation

manual configuration

other

The difference between hash and history:

        Hash mode, after the url, there will be #, change the hash, the page will not be refreshed, the entire page will not be changed, only the content of the routing configuration behind # will be changed;

        Hash principle: Find the corresponding routing rules by listening to the browser's onhashchange() event change;

        History mode: there is no # after the url, it looks more beautiful

        The disadvantages are: (1) If the chain/info/steps route cannot be found, an error 404 will be reported, so you need to set the situation if no resource is matched, (2) Every time you refresh, you will request the entire URL from the backend again. is to re-request the server;

        History principle: Use two new APIs pushState() and replaceState() in H5's history and an event onpopstate to monitor URL changes;

Guess you like

Origin blog.csdn.net/m0_61663332/article/details/132577889