current position:Home>Summary of compatibility processing of H5 + Vue cli project in Safari browser

Summary of compatibility processing of H5 + Vue cli project in Safari browser

2022-05-15 02:06:39Wooden house x

About H5+vue-cli The project in Safari Summary of compatibility processing scheme in browser

Requirements describe :
  • Recently vue-cli Developed H5 Wechat is integrated in the project JSSDK To solve some needs in the project , I encountered compatibility problems during project testing : stay android Wechat browser of the system and PC There is no problem in the end wechat developer tool , But in IOS Systematic Safari When testing in the browser, I found , When you reach the specified page , On the page JSSDK Authentication needs to use the of the current page url Information , Obtained after refreshing the page at this time url Information cannot be updated in time , Cause the current page to be reused url Authentication failure will be reported when the information is authenticated ; Another way , When you refresh the current page and then go back to the superior page , Then enter the target page , This is normal . After the test, the preliminary judgment is Safari There is a compatibility problem with the browser .
Solution :
  • After the above problems, it is found that ,vue-cli The project in Safari After refreshing in the browser, the routing information of the current page is the same as url The information is not updated synchronously , This has led to the occurrence of the above problems .

  •   //  Online feedback this.$outer.go() Methods are not compatible Safari, In fact, the vue-router Is with the Safari There is a compatibility problem with the browser , You can actually see that vue-router It's not just go() Method , There are also compatibility problems , It just doesn't matter if you don't use it in a specific environment . although vue-router It's also based on the underlying browser history Routing operations , however history And Safari There are compatible , There is also feedback online history.go() Methods are not compatible Safari, in other words HTML5 Some of the new features are related to Safari There are compatible .
      <

copyright notice
author[Wooden house x],Please bring the original link to reprint, thank you.
https://en.qdmana.com/2022/132/202205120527038047.html

Random recommended