404页面
404页面的配置很简单,只用了一个GIF动图,以及使用elemen-ui的布局;在点击按钮上使用了手动路由。
居中布局
使用
flex布局,并且水平对齐方式为center设置按钮点击事件
<el-row type="flex" justify="center">
<el-col :xs="24" :sm="12">
<div class="four_zero_four_bg">
<h1 class="text-center">404</h1>
</div>
<div class="contant_box_404">
<h3 class="h2">Look like you're lost</h3>
<p>the page you are looking for not avaible!</p>
<el-button type="success" @click="handlegoHome">Go to Home</el-button>
</div>
</el-col>
</el-row>CSS设置背景
text-align :center用于将el-col内的字居中.four_zero_four_bg设置了GIF图片的显示
路由跳转事件
当用户点击是,调用
router中的push函数进行手动路由跳转
Last updated
Was this helpful?