1.vue Packaging After the implementation of local browsing
Solve:
Add a point to the Assetspublicpath in the build section
Assetspublicpath: '/',
2. Page rendering blank after packing and throwing to service
The reason: When the history mode is turned on, no route is processed
Workaround:
(1) Remove history mode
(2) Just modify the Index.js in router, add your project name to each path, and you will be able to succeed.
3. Performance optimization
(1) Use keep-alive with Route.meta cache page to avoid duplicate requests
(2) The use of v-if and v-show differences v-if have the process of creation and destruction, v-if when the value is true, the display div, when the value is false, the element disappears, the code disappears, equivalent to the code is deleted, when in true, the page will re-render the div; The v-show just sets the CSS property to Display:none or block, and how the JS code is executed.
(3) Use V-if to be aware of the timing of DOM updates, it is generally necessary to wait until the rendering is complete to get the properties of the component, with this. $nextclick () use