location.href 和 window.open的使用


location.href 和 window.open

  window.open(pageURL,name,parameters): 它会打开一个新的浏览器窗口 

  window.localtion.href ="url" :  在当前页面跳转 (window可以省略)

需求:

          

代码如下:

andiro(){ //安卓下载         location.href='http://res-lfl.xaigame.com/publish/liaofanlv-3.apk'  },  toIos(){   //Ios下载         window.open('https://apps.apple.com/cn/app/id1582962075','_self') }, tobaseDown(){  //下载pc压缩包   location.href='http://res-lfl.xaigame.com/publish/xxx.rar' }