第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

vue 渲染瀏覽器崩潰

vue 渲染瀏覽器崩潰

桃花長相依 2019-03-20 19:15:13
在使用數(shù)據(jù)v-for渲染時這是導航欄這是內容兩個都存在for循環(huán)渲染數(shù)據(jù)如果是兩個同時加載,瀏覽器就會奔潰,數(shù)據(jù)量并不大 在20條左右如果是先將內容注釋掉,加載了導航欄之后,再把注釋去掉 就能正常運行,但一刷新,兩個同時加載了,瀏覽器就又奔潰了。請問 該怎么解決
查看完整描述

2 回答

?
一只斗牛犬

TA貢獻1784條經驗 獲得超2個贊

用v-if控制一下渲染條件看看


查看完整回答
反對 回復 2019-03-27
?
大話西游666

TA貢獻1817條經驗 獲得超14個贊

碰到了一樣的問題,渲染的時候瀏覽器崩潰

https://img1.sycdn.imooc.com//5c9b35cd0001884508000205.jpg

是在滑到底加載下一頁的時候,分頁效果,寫過好幾次這種效果,這是頭一次碰到

    methods: {

        //滾動條在Y軸上的滾動距離

        getScrollTop() {

            let scrollTop = 0,

                bodyScrollTop = 0,

                documentScrollTop = 0;

            if(document.body) {

                bodyScrollTop = document.body.scrollTop;

            }

            if(document.documentElement) {

                documentScrollTop = document.documentElement.scrollTop;

            }

            scrollTop = (bodyScrollTop - documentScrollTop > 0) ? bodyScrollTop : documentScrollTop;

            return scrollTop;

        },

        //瀏覽器視口的高度

        getWindowHeight() {

            let windowHeight = 0;

            if(document.compatMode == "CSS1Compat") {

                windowHeight = document.documentElement.clientHeight;

            } else {

                windowHeight = document.body.clientHeight;

            }

            return windowHeight;

        },

        //文檔的總高度

        getScrollHeight() {

            let scrollHeight = 0,

                bodyScrollHeight = 0,

                documentScrollHeight = 0;

            if(document.body) {

                bodyScrollHeight = document.body.scrollHeight;

            }

            if(document.documentElement) {

                documentScrollHeight = document.documentElement.scrollHeight;

            }

            scrollHeight = (bodyScrollHeight - documentScrollHeight > 0) ? bodyScrollHeight : documentScrollHeight;

            return scrollHeight;

        }

    },

},

mounted(){

    this.defaults(this.currentPage);

    window.onscroll = () => {

        if(this.getScrollTop() + this.getWindowHeight() == this.getScrollHeight()) {

            this.defaults(++this.currentPage);

        }

    };

},


查看完整回答
反對 回復 2019-03-27
  • 2 回答
  • 0 關注
  • 1483 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網(wǎng)微信公眾號