Window.onload () = window.onload(); window.onload() = window.onload(); window.onload(); window.onload(); window.onload();

In jquery, $(function () {}) is used, which is similar to the onload function and executes automatically after the document is loaded.

Here’s the problem: This causes the function to execute only when the document has finished loading.

In vUE, in order to save resources, vue-Router does not actually jump to the page, but only changes some content on the original page. Therefore, in VUE, the page is not refreshed when jumping to the child route, that is, the onload condition is not triggered.

$(function () {}) does not refresh the page when jumping to the child path, that is, there is no loading of amaze.min.js function.

In fact, in the template, you can also see a phenomenon, when refreshing the page, you can also see a flash of a large, obviously, Amazeui select rewrite, but does not change the original SELECT tag, but hide it, leopard cat for prince, A new div is placed in the place of the original select tag, and the js file is not reloaded, so the select tag is not replaced with the new select control.

The solution adds a Method to the component that acts as the navigation, causing the Router to refresh the page when it jumps to a child route.

Simple implementation:

First add a function to methods that acts as a navigational jump component:

This.$router.go(0) means refresh the page.

Then bind the event function to the router-link tag of the jump: after the jump, the page is refreshed, and external resources within the page are reloaded and rendered successfully.