current position:Home>[taro react] - H5 route configuration cancels # on the route
[taro react] - H5 route configuration cancels # on the route
2022-04-29 09:35:30【Rattenking】
Default package access route
https://{ {domain}}/#/pages/index/index
Expect packaged access routes
https://{ {domain}}/pages/index/index
Solution document
taro Routing related configuration h5.router
Configure routing mode
Configure routing mode .‘hash’ And ‘browser’ They correspond to each other hash Routing mode and browser history Routing mode . The default value is :‘hash’.
example
Modification item config/index.js
module.exports = {
// ...
h5: {
// ...
router: {
mode: 'browser' // Or is it 'hash'
}
}
}
For the above configuration , call Taro.navigateTo({ url: ‘/pages/index/index’ }) after , The browser address bar will be changed to :
- https://{ {domain}}/#/pages/index/index(hash Pattern )
- https://{ {domain}}/pages/index/index(browser Pattern )
copyright notice
author[Rattenking],Please bring the original link to reprint, thank you.
https://en.qdmana.com/2022/119/202204290807048901.html
The sidebar is recommended
guess what you like
Ajax learning notes
Relearn react (1) - recognize the life cycle
Small problems encountered by react usereducer and Solutions
CSS realizes the square of adaptive screen width
Nginx + ModSecurity setup
Bootstrap web job
bootstrap
Swoft 2. X Foundation (HTTP, database, redis)
Docker actual combat case 2: nginx load balancing
Vue basic syntax
Random recommended
- Go basic syntax 3 (socket, httpserver)
- Nginx configures HTTPS and calls http
- Nginx parsing vulnerability
- How can the backend package Vue projects quickly
- Netty configures WSS protocol access through nginx (Practical)
- Total permutation problem_ Not containing the same element and containing the same element_ Leetcode46_ Leetcode47_ Backtracking solution + java code
- How to upload and download files using Axios in nodejs
- Vue excel file upload
- CondaHTTPError: HTTP 000 CONNECTION FAILED for url < https://conda.anaconda.org/fastai/noarch/repodat
- Multi function environmental monitoring pole scheme based on wireless gateway
- JPS in Hadoop, but http://hadoop01:50070/ How to solve the problem if there is no interface? 500ha70 cluster can't be accessed?
- Tool class for obtaining specific information in HTTP request
- UAV project tracking record 65 - wireless transceiver module circuit
- UAV project tracking record 76 - wireless transceiver module circuit
- Basic concept of angular velocity
- Front end login password encryption and decryption
- Vue parent-child component mutual transmission and intermodulation
- Vue nested loop array, select one of them and add the selected style
- The Vue seamless scroll list scrolls automatically
- Vue line graph moves dynamically to the right
- Install and configure nginx in Linux Environment
- Vue dynamically binds attributes and dynamically obtains attribute values
- Summary method of Vue value in key pair mapping
- Vue simply realizes the addition, deletion and modification of each tab page without route jump
- Vue time control common processing
- Vue validation array
- Simple and easy to let you know what AJAX is, even if you are a little white, a rookie can understand it!
- Receive the JSON string from the front end, and summarize the methods of parsing and value taking at the back end
- Solution: httpmessagenotreadableexception: JSON parse error: invalid UTF-8
- Vuetify: install vuetify from scratch
- Install CSS from tailwind
- Ubuntu 16 wireless network card model query and driver installation, Lenovo g400 bcm43142 network card WiFi
- Some color knowledge to understand at the front end
- Functional programming of front-end development
- A front-end interview question -- implementing an encapsulated Ajax device (promise version)
- Dynamic components of angular
- Front end written test pit -- JS implicit conversion
- Shallow understanding of HTTP
- React style modification background invalid
- Finding the k-th small element of ordered matrix (dichotomy idea)