简体   繁体   中英

Lost data on reload component in vue

this's mine project: https://pokedex-vue-sf.netlify.app/

when i go on pokemon details and reload page I get 404 page. How can I fix that? I tried with localStorage but I did not succeed

  1. It is because you're reloading '/pokemon/bulbasaur' route. You must configure your server to serve '/' for all routes.

  2. Or you could toggle your history mode in your vue-router. This will add a '#' after your base url. Anything after # will not be sent to the server, so you will always be requesting the '/' route.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM