H5+Vue

作者: Daeeman | 来源:发表于2020-04-26 16:14 被阅读0次

启动配置

// vue.config.js
  host: "192.168.31.148", //本地服务器访问的路径

// manifest.json
"launch_path" : "http://192.168.31.148:8080/"

历史记录

// App.vue
   mounted(){
       var that = this; 
       document.addEventListener('plusready', function(){
           window.plus.nativeUI.toast('积分+5')
           window.plus.key.addEventListener("backbutton",()=>{

                if(that.$router.history.current.name==="Home"){
                    window.plus.nativeUI.confirm("确认要关闭app?",(e)=>{
                        if(e.index==0){
                         window.plus.runtime.quit();
                            // 如果用户单击的是确定,退出app
                        }
                    })
                }else{
                        that.$router.back();
                }            
             })

       })      
   }

改变status背景

created(){
    this.uname = Cookie.getCookie("uname");  
    window.plus.navigator.setStatusBarBackground("#f30");
},
beforeDestroy(){
    window.plus.navigator.setStatusBarBackground("#999");
},

相关文章

  • H5+Vue

    启动配置 历史记录 改变status背景

  • js h5拉起拨打电话

    h5+vue拨打电话功能其实很简单,但是经过测试ios不行。这边我给大家说下我们的解决办法 ⚠️ 简单来说,a标签...

网友评论

      本文标题:H5+Vue

      本文链接:https://www.haomeiwen.com/subject/hmhjwhtx.html