VUE H5 页面 开发(问题)记录

1、返回按钮 都请求接口

created() {
            window.addEventListener('pageshow', () => {
                //外链回退到vue应用要执行的代码
                //this.pageshowGetData();

            })
        },

2、引入相关js即可开发vue h5

 

3、helang-flexible.js 

转换px为rem方式  75rem为整页宽度,实用兼容性比较好。

 

4、不封装可直接用axios请求接口

 

//站内信息
            getNoticeList: function () {
                let that = this;
                let query = {
                    token: this.token,
                    pageNumber: 1,
                    pageSize: 3,
                }
                //+'?token='+this.token
                axios.post(ctx + getCmsNoticeList.url, qs.stringify(query)).then(function (res) {
                    //console.log(res.data.data.content);
                    if (res.data.code != '0') {
                        that.$toast.fail(res.data.msg);
                    } else {
                        that.noticeList = res.data.data.content;
                    }
                });
            },

 5、首次进入首页

window.location.replace 跳转不带记录
window.location.replace(""+foreCtx + "/index/home.html?token="+token+"");

 

posted @ 2021-08-23 10:40  熊大大001(前端开发)  阅读(197)  评论(0)    收藏  举报