this.$router.push网页跳转
时间: 2023-10-18 18:31:04 浏览: 93
Vue this.$router.push(参数)实现页面跳转操作
Sure! Here is an example of HTML code for creating a button that redirects to another web page when clicked:
```html
<!DOCTYPE html>
<html>
<head>
<title>Button Redirect</title>
</head>
<body>
<button onclick="window.location.href = 'https://www.example.com';">Go to Example</button>
</body>
</html>
```
In this code, the `<button>` element is used to create the button. The `onclick` attribute is set to a JavaScript code that changes the `window.location.href` property to the desired URL (in this case, 'https://www.example.com'). When the button is clicked, the browser will navigate to the specified webpage.
阅读全文