Write the Code. Change the World.

分类目录
8月 12

引入 VueRouter,访问多次访问同一个路由,就会报: Error: Avoided redundant navigation to current location: 的错。虽然不影响功能,可不好看呀。

处理

在引入 VueRouter 的地方,处理:

// 解决点击重复路由报错问题
const originalPush = VueRouter.prototype.push
   VueRouter.prototype.push = function push(location) {
   return originalPush.call(this, location).catch(err => err)
}

Vue.use(VueRouter);
…
8月 05

直接用 laravel ui 以及 webpack.mix.js 来打包编译纯 vue 项目,也会出现尴尬场面。比如,使用的路由问题,根目录问题以及路由的 rowserHistory 和 hashHistory 选择上,都会出现尴尬情况。如果只是单纯的后台,非根目录项目,还不如独立建立一个文件夹,来组织打包来的爽快。

8月 04

上一篇,把基本的构建做成了。不过,页面不够完善。现在结合接口,来做一波。尽管如此,这篇没有使用的 vuex 状态管理,也是不完美的。
继续阅读

10月 10

axios 拦截器,最佳实践,体验相关:

https://www.cnblogs.com/dhsz/p/6410031.html

https://blog.csdn.net/panyox/article/details/73800241

https://blog.csdn.net/sjn0503/article/details/74729300

http://www.php.cn/js-tutorial-399867.html

如果是 vue 中。可以在路由里先做一步判断,然后请求时 axios 拦截器里边也做处理。这样就可以完美解决问题了。

request 中添加 token,response中处理错误。

Promise 相关

https://www.cnblogs.com/yunfeifei/p/4453690.html

https://www.cnblogs.com/sweeeper/p/8442613.html

jwt bearer token 相关

https://www.cnblogs.com/zfdcp-028/p/6374632.html

https://www.jianshu.com/p/8f7009456abc

https://www.jianshu.com/p/f9faeac8bd5e

https://www.cnblogs.com/Leo_wl/p/7792046.html

8月 31

Vue 用脚手架本地测试,项目都是指向根目录,当发布到外网环境,非根目录时,有人会遇到根本进不去 vue 路由的情况。

既然用了 vue ,遇到问题总的要解决。

网上一些有用的方法

https://segmentfault.com/a/1190000014561644

https://blog.csdn.net/lensgcx/article/details/78439514

其实主要还是得处理 nginx 的 location

处理 location 的规则即可。

location 可以添加很多个不同规则。

比如:

location /{

}

location /web{
    try_files $uri $uri/ /web/index.html;
} 
# vue 这里的二级目录是 web 
9月 21

vue

https://cn.vuejs.org/

https://www.awesomes.cn/

http://element.eleme.io/#/zh-CN/

https://www.iviewui.com/

https://n3-components.github.io/N3-components/component.html

bootstrap + vue

http://yuche.github.io/vue-strap/

https://bootstrap-vue.js.org/

https://uiv.wxsm.space/getting-started/

react

https://ant.design/index-cn

css study

http://cssreference.io/

js effects

https://threejs.org/

https://github.com/iview/iview-doc

https://threejs.org/examples/?q=waves#canvas_particles_waves

https://segmentfault.com/q/1010000010716445