VUE--404页面
<一 404 动态页面>
<!-- 2017/5/26- yyy-404页面-->
<template>
<section class="page__404" :style="{height:height+'px'}">
<div class="error-container">
<div class="page__error">
<div id="pacman"></div>
</div>
<div class="page__container">
<div class="page__title">
<h1>对不起, 你访问的页面不存在!</h1>
</div>
<div class="page__content clearfix">
<div class="left">
<p>可能是如下原因引起了这个错误:</p>
<ol type="I">
<li>URL输入错误</li>
<li>链接已失效</li>
<li>其他原因...</li>
</ol>
</div>
<div class="right">
<p>推荐您通过以下链接继续访问本网站:</p>
<ol class="links" type="I">
<li><a href="http://www.huamoe.com">» 画萌官网</a></li>
<li><a href="http://weibo.com/punion">» 画萌微博</a></li>
<li><a href="http://www.chinarising.com.cn/">» 美盛文化</a></li>
</ol>
</div>
</div>
<div class="page__footer">
浙ICP备16022393号-1 浙公网安备 33010802006150号
</div>
</div>
</div>
</section>
</template> <script> export default {
data:()=>{
return {
height:"",
}
},
mounted(){
this.icon();
let ele = document.getElementById("pacman");
this.toggleClass(ele, "pacman_eats");
},
methods:{
icon(){
let _this = this;
_this.height = window.innerHeight;
window.onresize=function(){ // 屏幕变化时,高度自适应
_this.height = window.innerHeight;
};
setInterval(function(){
let ele = document.getElementById("pacman");
_this.toggleClass(ele, "pacman_eats");
}, 300);
let current = 0;
let errAll = document.getElementsByClassName("page__404")[0];
setInterval(function(){
current -= 1;
errAll.style.backgroundPosition = current + "px";
}, 50);
},
hasClass(ele, cls) {
return ele.className.match(new RegExp("(\\s|^)" + cls + "(\\s|$)"));
},
addClass(ele, cls) {
let _this = this;
if(!_this.hasClass(ele, cls)) ele.className += " " + cls;
},
removeClass(ele, cls) {
let _this = this;
if (_this.hasClass(ele, cls)) {
let reg = new RegExp("(\\s|^)" + cls + "(\\s|$)");
ele.className = ele.className.replace(reg, " ");
}
},
toggleClass(ele, cls) {
let _this = this;
if(_this.hasClass(ele, cls)) {
_this.removeClass(ele, cls);
} else {
_this.addClass(ele, cls);
}
}
}
}
</script> <style lang="scss" scoped>
@import "../../common/css/reset.css";
@import "../../common/css/define";
.page__404 {
width: 100%;
height: 100%;
text-shadow: 0 1px 0 #ffffff;
filter: dropshadow(color=#ffffff, offx=0, offy=1);
text-align: center;
background-color:#aaa;
background-image:url('./images/maze_bg.png');
overflow: hidden;
}
.page__error {
background:transparent url('./images/404e.png') right 35px no-repeat;
}
.page__error #pacman {
background:transparent url('./images/pacman_eats.png') 0 0 no-repeat;
}
.pacman_eats {
background:transparent url('./images/pacman_eats.png') 0 -207px no-repeat!important;
}
.page__container {
width:760px;
margin:0 auto;
border:1px solid #E0E0E0;
border-top:1px solid #fff;
border-bottom:1px solid #ccc;
background-color:#E5E5E5;
box-shadow: 0 1px 0 rgba(255, 255, 255, 0.2) inset, 0 2px 4px rgba(0, 0, 0, 0.7);
}
.page__container .page__title {
border-bottom:1px solid #aaa;
overflow:hidden;
background-color:#E7E7E7;
text-align: center;
}
.page__container .page__content {
border-top:1px solid #fff;
border-bottom:1px solid #aaa;
}
.page__container .page__content ol{
margin-top: 10px;
li {
font-size: 16px;
margin: 8px 0;
a {
color: #000000;
font-weight: bold;
transition: all 0.1s linear;
&:hover {
color: #f9798e;
}
}
}
}
.page__container .page__footer {
padding:10px 20px 10px 20px;
border-top:1px solid #f5f5f5;
font-size:14px;
color: #555;
background-color:#D5D5D5;
}
.page__container .left {
padding:30px 10px 20px 50px;
width:350px;
float:left;
}
.page__container .right {
padding:30px 20px 20px 10px;
width:320px;
float:right;
} .error-container {
display:block;
text-align: left;
width: 960px;
margin: 0 auto;
padding-top:40px;
padding-bottom:40px;
}
.page__error {
background:transparent url('./images/404e.png') right 35px no-repeat;
width:680px;
height:280px;
position:relative;
margin:0 auto;
}
.page__error #pacman {
width:207px;
height:207px;
position:absolute;
left:0px;
top:16px;
background:transparent url('./images/pacman_eats.png') 0 0 no-repeat;
animation:eats 2s linear 0s infinite alternate;
}
.pacman_eats {
background:transparent url('./images/pacman_eats.png') 0 -207px no-repeat!important;
}
@keyframes eats {
from {
left:0px; top:16px;
}
to {
left:200px; top:16px;
}
} </style>



VUE--404页面的更多相关文章
- Vue 404页面处理
问题原因: 刷新页面时访问的资源在服务端找不到,因为vue-router设置的路径不是真实存在的路径 解决方案: 第一步:后端配置 Apache <IfModule mod_rewrite.c& ...
- vue 项目中当访问路由不存在的时候默认访问404页面
前言: 在Vue项目中,当访问的页面路由不存在或错误时,页面显示为一片空白.然而,通常我们需要对访问url不存在或者错误的情况下添加默认的404页面,即not found页面. 一般的处理方法是: 在 ...
- nignx部署Vue单页面刷新路由404问题解决
官网说明: https://router.vuejs.org/zh/guide/essentials/history-mode.html#%E8%AD%A6%E5%91%8A 在linux下搭建ngi ...
- 066——VUE中vue-router之rewrite模式下配置404页面
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...
- vue+webpack 打包文件 404 页面空白
最近用vue-cli+vue-router+webpack建立项目,其中的遇到的三个问题,整理如下: vue-cli+ webpack 建立的项目,cnpm run build 打包项目之后,需要放在 ...
- vue hash模式和404页面的配置
1.设置我们的路由配置文件(/src/router/index.js): { path:'*', component:Error } 这里的path:’*’就是找不到页面时的配置,component是 ...
- Vue 实现动态路由及登录&404页面跳转控制&页面刷新空白解决方案
Vue实现动态路由及登录&404页面跳转控制&页面刷新空白解决方案 by:授客 QQ:1033553122 开发环境 Win 10 Vue 2.9.6 node-v ...
- 2种方式解决vue路由跳转未匹配相应路由避免出现空白页面或者指定404页面
https://www.cnblogs.com/goloving/p/9254084.html https://www.cnblogs.com/goloving/p/9254084.html 1.路由 ...
- vue单页面打包文件大?首次加载慢?按需加载?是你打开方式不对
部署各vue项目,走了一遍坑.... vue单页面应用刷新404 找到nginx多网站配置文件:类似nginx/sites-available/www.baidu.com server { liste ...
- thinkphp访问不存在的模块或者方法跳转到404页面
使用的thinkphp 版本是3.2.0, 在config.php中配置 404地址,即可: 'TMPL_EXCEPTION_FILE' => './Application/Home/View/ ...
随机推荐
- OCR(Optical Character Recognition)算法总结
https://zhuanlan.zhihu.com/p/84815144 最全OCR资料汇总,awesome-OCR
- 使用vue搭建应用四引入axios
Axios 是一个基于 promise 的 HTTP 库,可以用在浏览器和 node.js 中 特性 从浏览器中创建 XMLHttpRequests 从 node.js 创建 http 请求 支持 P ...
- Laravel实现from的curl文件转发
文件的使用curl分发时发现不能直接将其传入curl,需要使用CURLFile()来实现 分发类 <?php /** * 请求转发控制器 * Created by PhpStorm. * Use ...
- 用js实现call方法
Function.prototype.call2 = function (context, ...args) { var context = context || window; //改变th ...
- Oracle Spatial分区应用研究之七:同等分区粒度下全局索引优于分区索引的原因分析
1.实验结论 同等分区粒度下,使用分区空间索引进行空间查询,比使用全局空间索引进行查询,对数据字典表的访问次数更多.假设分区数为X,则大概多3X次访问.具体说明见6实验结论. 2.实验目的 在之前的测 ...
- jquery如何生成图片验证码
jQuery(function($){ /**生成一个随机数**/ function randomNum(min, max) { return Math.floor(Math.random() * ( ...
- 在使用Hanlp配置自定义词典时遇到的问题
要使用hanlp加载自定义词典可以通过修改配置文件hanlp.properties来实现.要注意的点是: 1. root根路径的配置: hanlp.properties中配置如下: #本配置文件中的路 ...
- 服务器BMC资料整理
1. 现在服务器都有BMC管理了,可以直接连上服务器进行处理. bios里面进行简单设置就可以了, 连接上IPMI的口进行管理. 2. 可以使用 远程控制安装操作系统. 安装系统时 比较清楚的能够看到 ...
- 长乐国庆集训Day1
T1 统计数字 题目 [题目描述] 设 S(N ) 表示 N 的各位数字之和,如 S(484) = 4+8+4 = 16, S(22) = 2+2 = 4. 如果一个正整数满足 S(x*x) = S( ...
- 1. Spark GraphX概述
1.1 什么是Spark GraphX Spark GraphX是一个分布式图处理框架,它是基于Spark平台提供对图计算和图挖掘简洁易用的而丰富的接口,极大的方便了对分布式图处理的需求.那么什么是图 ...