Weex navigator Jump Page transfer parameters

Click to jump to the details page. You need to pass parameters and how to pass and obtain

.
Apr.09,2021

add parameters to url. For example, when http//ip:port/mypath?arg1=xx&arg2=xx
accepts, parse the parameters in url by yourself


navigator.push ({url: xxxx?key=xxx})

let url = weex.config.bundleUrl
function getDataByUrl (key, url) {/ / key parameters

  name = name.replace(/[\[\]]/g, "\\$&");
  var regex = new RegExp("[?&]" + key + "(=([^&-sharp]*)|&|-sharp|$)"),
  results = regex.exec(url); 
  if (!results) return null;
  if (!results[2]) return '';
  return decodeURIComponent(results[2].replace(/\+/g, " "));

} / / the result is the required parameter value


:
this.$router.push({
            path: "/test", //
            query: ,
        });
  :
    = this.$route.query
   
        
        
Menu