When I was working on a project today, the page jump was not displayed, and it would only be displayed after refreshing, which would affect the experience. I learned how to solve it after asking for advice.
first look at the problem
After the jump, it will appear and need to be refreshed before it will be displayed;
Solution: Wrap all content in the template with an empty div; because a root element is required for output, and this div acts as the root element