[vue project] jump page

1. Jump to the external link page

Replace current page (relocate current page): window.location.href
EX: window.location.href = "http link"

Open new window: window.open()
EX: window.open("https://www.xxx.com")

The difference between window.location.href and window.open(): https://blog.csdn.net/lhban108/article/details/110929435

2. Jump to the html page in the project

1. Routing jump can be realized by modifying the url; jump to the specified routing address

this.$router.push({
    
    
    path: "recruitment-detail",
})

2. In the root directory of the project, if there is a public folder, put it directly into the public folder, start at the same level as index.html, and access it according to the project path.
For example: Create pages/test.html in public, then: The browser access path is: http://host:port/pages/test.html
Note that at this time, all js/css/image etc. referenced in the test.html file The path must be changed to the form of an absolute path starting from the root directory of the project.

3. If the root directory of the project is not public but has a static folder, then put /pages/test.html into the static folder and access it according to the absolute path of static. For example: create new
pages/test2.html in static, then The browser access path is: http://host:port/static/pages/test2.html
Note: At this time, in the test.html file, all js, css, images and other paths referenced must be changed to /static/xxx In the form of /xxx.xx, in this project, the css file referenced by test2.html is stored in the path: static/pages/css/test2.css, and the reference in test2.html should be: /static/pages/ css/test2.css

Reference link: https://www.cnblogs.com/kebaoye/p/15970258.html

3. Handling of garbled codes in html pages in the project

1. Causes of garbled characters
① For example, the source code of the web page is encoded in gbk, while the Chinese characters in the content are encoded in utf-8, so html garbled characters will appear when the browser opens it. On the contrary, if the webpage is encoded in utf-8 and the content is gbk, there will be garbled characters.

②The encoding of the html webpage is gbk, and the content that is called by the program from the database and presented as utf-8 encoding will also cause garbled encoding.

③The browser cannot automatically detect the encoding of the web page, resulting in garbled characters on the web page.

2. To solve the garbled code,
add it to the html head tag

<meta charset="utf-8">

EX:

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

Reference link: https://blog.csdn.net/qq_41046162/article/details/128557979

Guess you like

Origin blog.csdn.net/m0_46459413/article/details/131088845