帮我生成一个简洁高级的404页面用vue2.0
时间: 2024-02-27 22:58:01 浏览: 20
当页面不存在时,我们可以为用户提供一个优美的404页面,让用户感受到我们的专业和用心。下面是一个简洁高级的404页面的示例代码,基于Vue2.0:
```
<template>
<div class="error-page">
<h1>404</h1>
<p>Oops! Page not found.</p>
<router-link to="/">Return to home page</router-link>
</div>
</template>
<script>
export default {
name: 'ErrorPage'
}
</script>
<style scoped>
.error-page {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
height: 100vh;
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
font-size: 24px;
color: #333;
}
h1 {
font-size: 120px;
font-weight: bold;
margin: 0;
color: #ccc;
}
p {
margin: 20px 0 0;
}
router-link {
color: #dc8100;
margin-top: 20px;
text-decoration: none;
}
router-link:hover {
color: #ff7f00;
text-decoration: underline;
}
</style>
```
在这个示例中,我们使用了flex布局,使得页面居中且响应式,同时使用了路由链接,方便用户返回主页。通过修改样式,您可以根据自己的需要进行美化。