天天看點

關于url的一些記錄

url末尾加不加’/'的差別

假如不再url末尾加’/’,那麼當你改變url時,如使用router-link to 或者 router.push時,會自動将末尾的替換掉。

例:

// original: http://localhost:8080/index/921/1
<router-link to="blog-post.html">Read more</router-link>
// change: http://localhost:8080/index/921/blog-post.html
           

若有加/

// original: http://localhost:8080/index/921/1/
<router-link to="blog-post.html">Read more</router-link>
// change: http://localhost:8080/index/921/1/blog-post.html
           

繼續閱讀