Giter Club home page Giter Club logo

Comments (5)

halfrost avatar halfrost commented on May 26, 2024

能告诉我一下你具体在哪里把路由给成 history 模式的么?

from vue-objccn.

lemonwong avatar lemonwong commented on May 26, 2024

const router = new Router({
// mode: "history",
routes,
scrollBehavior(to, from, savedPosition) {
if (savedPosition) {
setTimeout(() => {
window.scrollTo(savedPosition.x, savedPosition.y);
}, 200);
} else {
return { x: 0, y: 0 };
}
}
});

export default router;

就是在这里了

from vue-objccn.

halfrost avatar halfrost commented on May 26, 2024

试了一下。。。好像确实不行。。。我当时好像没有注意到这里。近期一直在忙 Go 的项目。你对这个功能很急么?(不是我吐槽,cordova 的性能放在现在来看真心差。。两年前还勉强可以)

from vue-objccn.

lemonwong avatar lemonwong commented on May 26, 2024

倒不急,现在用hash能用,就是页面后退的时候记不住上次的浏览位置了,难道跟协议有关?cordova打包的应用,访问页面的时候应该使用的是file://吧 (btw,用cordova也是无奈的过渡之举···)

from vue-objccn.

smileG avatar smileG commented on May 26, 2024

在服务器上,history 模式需要后端配合 ,找不到文件时返回Index让前端路由处理,在手机APP上,找不到没有处理所以不行。

from vue-objccn.

Related Issues (19)

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.