做法為:
1、首先給要滾動變化的導航新增
:style="style"
fixed title="個人中心
" :style="
style
">
"/" slot="
left
"class="
news_box
">
"overflow: visible;
">
class="
iconfont news_icon
">
class="
news_num
">4
"/" slot="
right
">
class="
iconfont set_icon
">
2、在 data 資料中宣告需要的變數
data () ,opacity: 0};
},
3、變化樣式
(a): 基於 scroll 做的滾動的方法
created () );},methods: );
this.mainbodyscroll.on('
scroll
', (pros) =>)`};
}); }
}
(b):沒有用框架的滾動,自然滾動
window.onscroll = ()=>)`});}
這樣便可以實現導航的漸變了。
同時有很多那種在滾動的時候出現的控制類的,例如高度滾動到什麼位址的時候,某乙個都東西固定不動了。
MUI導航欄透明漸變 原生JS實現
body,p,h1 module layer module layer content module layer bg layer head name layer return,layer share layer return layer share fixed layer relative lay...
基於vue2寫的上拉載入
因為我們專案中,還用了swiper。很多都是滑動切換的,但是又得上拉載入,所以導致,很多ui框架,我們用了,都有不同的bug出現,沒辦法,最後寫了乙個。如下 這個因為很多地方會用,所以建議放在components common下面 template div class loadmore slot s...
基於requirejs的vue2專案 三
這裡是打包篇 使用的是requirejs的r.js進行打包 思路是,通過entrance.js裡面的require.config進行專案的初打包 因為router.js和store.js裡面的引用是動態生成的,所以r.js無法對其進行處理,這裡我們用到了nodejs來進行檔案整合 具體看 node2...