Code Monkey home page Code Monkey logo

firstvue's People

Contributors

angewell avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

firstvue's Issues

路由深度判断改写

前辈您好,学习了您的这个项目,受益良多,谢谢您。

我是这样处理main.js中的路由深度判断的,请您看看是否可取。

//调试信息输出:
// console.log('to.path : ' + to.path)
// console.log('to.path.length : ' + to.path.length)
// console.log('from.path : ' + from.path)
// console.log('from.path.length : ' + from.path.length)

/*特殊处理'/' 和 ‘’ 路由路径,
*如果处理到这两个路径,总是把它们当做最浅层的路径,把相应的depth记作0。
* 从而使得其他的所有路径,即使是同级的 '/detail' ,相应的depth为2, 也比这两个路径比较起来更深,以应用上正确的过渡动画。*/
const toDepth = ((to.path.length) <= 1) ? 0 : to.path.split('/').length
const fromDepth = ((from.path.length) <= 1) ? 0 : from.path.split('/').length
// 根据路由深度,来判断是该从右侧进入还是该从左侧进入
this.transitionName = toDepth < fromDepth ? 'slide_back' : 'slide'

可以的话,能允许我Pull一个request吗?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.