history

常用git命令

百般思念 提交于 2020-03-18 08:36:41
1. CONFIGURE TOOLING Configure user information for all local repositories $ git config --global user.name "[name]" Sets the name you want atached to your commit transactions $ git config --global user.email "[email address]" Sets the email you want atached to your commit transactions $ git config --global color.ui auto Enables helpful colorization of command line output 2. CREATE REPOSITORIES Start a new repository or obtain one from an existing URL $ git config --global user.name "[name]" Sets the name you want atached to your commit transactions $ git config --global user.email "[email

vue-router 结合源码分析原理

末鹿安然 提交于 2020-03-17 04:08:20
路由响应过程: 浏览器发出请求 服务器监听到num端口(或443)有请求过来,并解析url路径 根据服务器的路由配置,返回相应信息(可以是 html 字串,也可以是 json 数据,图片等) 浏览器根据数据包的 Content-Type 来决定如何解析数据 一般的vueRouter的代码模式是这样的: let router = new Router({ mode: 'history|hash|abstract', routes: [ { // 默认页 path: '*', redirect: to => { return '/' }, meta: { status: *** } }, { path: '/', name: '****', component: ****, meta: { status: *** } }, ], beforeEnter: (to, from, next) => {}), scrollBehavior: fun() }) 可以看到的是使用Router这个类进行实例化【new Router(options)】 在使用vueRouter的时候,我们会在项目中使用 Vue.use(Router) 安装,它会加载VueRouter中的 install 方法使得所有组件都可以使用router的实例( this.$router/this.$route )

bash: history: : cannot create: No such file or directory 问题处理!

做~自己de王妃 提交于 2020-03-15 23:46:23
问题如图 root@VM_0_13_centos /]# /etc/init.d/metasploit stop worker is stopped Exiting! metasploit is stopped prosvc is stopped nginx is stopped /opt/metasploit/postgresql/scripts/ctl.sh : postgresql stopped bash: history: : cannot create: No such file or directory [root@VM_0_13_centos /]# cd /root/ bash: history: : cannot create: No such file or directory [root@VM_0_13_centos root]# ls bash: history: : cannot create: No such file or directory 无论我在命令行输入什么命令都会提示 bash: history: : cannot create: No such file or directory 问题解决 [root@VM_0_13_centos ~]# echo $HISTROTY bash: history: : cannot create: No

uni-app打包成H5遇到的坑:打包H5出现白屏

旧巷老猫 提交于 2020-03-12 17:10:28
编译软件:HBuilderX 至于打包的详细步骤,请参考uni-app官网,这里只说我遇到的坑 可能是我之前学vue脚手架的时候,路由都是history,然后我就配置里面选择了history, 这直接导致打包后,部署到服务器上,打开页面出现白屏,应该选择路由模式为hash,或者默认不选,这样部署到服务器上就会显示你的页面内容了。 来源: CSDN 作者: 爱风度 链接: https://blog.csdn.net/qq_40476712/article/details/104820689

vue-router实现原理

*爱你&永不变心* 提交于 2020-03-12 09:05:45
近期面试,遇到关于vue-router实现原理的问题,在查阅了相关资料后,根据自己理解,来记录下。 我们知道vue-router是vue的核心插件,而当前vue项目一般都是单页面应用,也就是说vue-router是应用在单页面应用中的。 那么,什么是单页面应用呢?在单页面应用出现之前,多页面应用又是什么样子呢? 单页面应用与多页面应用 单页面 即 第一次进入页面的时候会请求一个html文件,刷新清除一下。切换到其他组件,此时路径也相应变化,但是并没有新的html文件请求,页面内容也变化了。 原理是:JS会感知到url的变化,通过这一点,可以用js动态的将当前页面的内容清除掉,然后将下一个页面的内容挂载到当前页面上,这个时候的路由不是后端来做了,而是前端来做,判断页面到底是显示哪个组件,清除不需要的,显示需要的组件。这种过程就是单页应用,每次跳转的时候不需要再请求html文件了。 多页面 即 每一次页面跳转的时候,后台服务器都会给返回一个新的html文档,这种类型的网站也就是多页网站,也叫做多页应用。 原理是:传统的页面应用,是用一些超链接来实现页面切换和跳转的 其实刚才单页面应用跳转原理即 vue-router实现原理 vue-router实现原理 原理核心就是 更新视图但不重新请求页面。 vue-router实现单页面路由跳转,提供了三种方式:hash模式、history模式

告别 hash 路由,迎接 history 路由

十年热恋 提交于 2020-03-11 23:07:31
博客地址: https://ainyi.com/69 三月来了,春天还会远吗、、 在这里,隆重宣布本博客告别 Vue 传统的 hash 路由,迎接好看而优雅的 history 路由~~ 映照官方说法 vue-router 默认 hash 模式 —— 使用 URL 的 hash 来模拟一个完整的 URL,于是当 URL 改变时,页面不会重新加载 如果不想要很丑的 hash,我们可以用路由的 history 模式,这种模式充分利用 history.pushState API 来完成 URL 跳转而无须重新加载页面 export default new Router({ mode: 'history', routes: [...] )} 当使用 history 模式时,URL 就像正常的 url,例如 https://ainyi.com/about ,好看又优雅! 不过这种模式要玩好,还需要后台配置支持。因为我们的应用是个单页客户端应用,如果后台没有正确的配置,当用户在浏览器直接访问 https://ainyi.com/about 就会返回 404,因为后端没有 /about 相应的拦截器,自然 404 所以,要在服务端增加一个覆盖所有情况的候选资源:如果 URL 匹配不到任何静态资源,则应该返回同一个 index.html 页面,这个页面就是 app 依赖的页面 后端实现

BGP-20190321-dampening

五迷三道 提交于 2020-03-09 14:12:09
BGP dampening(惩罚) BGP这个唯一的EGP协议、这个工作在AS by AS之间的外部网关路由协议、 具有了先天的稳定性、主要体现在以下方面: (1)采用TCP传输层协议、端口号179 (2)协议具有惩罚机制、对不稳定的路由进行惩罚、 下文将介绍惩罚的相关实验、证明BGP的稳定性、 (1)底层配置 上图中所有路由器都配有 Loopback 地址,地址分别为: R1 Loopback 0 1.1.1.1/32 R2 Loopback 0 2.2.2.2/32 所有路由器之间运行 OSPF,并将 Loopback 0 的地址发布到 OSPF 中,保证全网Loopback 0 之间是可以通信的。 (2)R1 与 R2 建立 eBGP 邻居关系。 R1: R1(config)#router bgp 1 R1(config-router)#bgp router-id 1.1.1.1 R1(config-router)#neighbor 2.2.2.2 remote-as 2 R1(config-router)#neighbor 2.2.2.2 update-source loopback 1 R1(config-router)#neighbor 2.2.2.2 ebgp-multihop R2: R2(config)#router bgp 2 R2(config-router)

vue router.push(),router.replace(),router.go()

谁都会走 提交于 2020-03-08 17:28:11
1.router.push(location)=====window.history.pushState 想要导航到不同的 URL,则使用 router.push 方法。这个方法会向 history 栈添加一个新的记录,所以,当用户点击浏览器后退按钮时,则回到之前的 URL。 1 2 3 4 5 6 7 8 9 10 11 // 字符串 router.push( 'home' ) // 对象 router.push({ path: 'home' }) // 命名的路由 router.push({ name: 'user' , params : { userId: 123 }}) // 带查询参数,变成 /register?plan=private router.push({ path: 'register' , query: { plan: 'private' }}) 2.router.replace(location)=====window.history.replaceState 跟 router.push 很像,唯一的不同就是,它不会向 history 添加新记录,而是跟它的方法名一样 —— 替换掉当前的 history 记录 3.router.go(n)====window.history.go 1 2 3 4 5 6 7 8 9 10 11 12 //

js保存数据到cookie

青春壹個敷衍的年華 提交于 2020-03-08 05:40:40
history.js 文件 ----------------------------------------------------------------------------------------------------- var addHistory=function(num,id){ stringCookie=getCookie('history'); var stringHistory=""!=stringCookie?stringCookie:"{history:[]}"; var json=new JSON(stringHistory); var e="{num:"+num+",id:"+id+"}"; //alert(e); json['history'].push(e);//添加一个新的记录 //alert(json.toString()); setCookie('history',json.toString(),30); } //显示历史记录 var DisplayHistory=function(){ var p_ele=document.getElementById('history'); while (p_ele.firstChild) { p_ele.removeChild(p_ele.firstChild); } var historyJSON

vue-router的hash 模式和 history 模式

这一生的挚爱 提交于 2020-03-07 17:45:35
hash 模式 url 中带有#的便是 hash 模式,#后面是 hash 值,它的变化会触发 hashchange 这个事件。 通过这个事件我们就可以知道 hash 值发生了哪些变化。然后我们便可以监听 hashchange 来实现更新页面部分内容的操作: window .onhashchange = function ( event ) { console .log(event.oldURL, event.newURL); let hash = location.hash.slice( 1 ); document .body.style.color = hash; } 另外,hash 值的变化,并不会导致浏览器向服务器发出请求,浏览器不发出请求,也就不会刷新页面。 history 模式 history api 可以分为两大部分,切换和修改 ① 切换历史状态 包括 back,forward,go 三个方法,对应浏览器的前进,后退,跳转操作 history.go( -2 ); //后退两次 history.go( 2 ); //前进两次 history.back(); //后退 hsitory.forward(); //前进 ② 修改历史状态 包括了 pushState,replaceState 两个方法,这两个方法接收三个参数:stateObj,title,url history