午夜剧场伦理_日本一道高清_国产又黄又硬_91黄色网战_女同久久另类69精品国产_妹妹的朋友在线

您的位置:首頁技術文章
文章詳情頁

Vue實現固定底部組件的示例

瀏覽:191日期:2023-02-08 09:32:42
目錄【實現效果】【實現方式】【實現效果】

Vue實現固定底部組件的示例

【實現方式】

<template> <div id='app'> <div class='main'> <img alt='Vue logo' src='http://www.leifengta.com.cn/bcjs/assets/logo.png'> <HelloWorld msg='Welcome to Your Vue.js App'/> <img alt='Vue logo' src='http://www.leifengta.com.cn/bcjs/assets/logo.png'> </div> <div class='footer'>這是固定在底部的按鈕</div> </div></template><script>import HelloWorld from ’./components/HelloWorld.vue’export default { name: ’App’, components: { HelloWorld }}</script><style>:root{ --footer-height: 50px;}body { padding: 0; margin: 0;}#app { font-family: Avenir, Helvetica, Arial, sans-serif; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-align: center; color: #2c3e50; margin-top: 60px;}.main{ padding-bottom: var(--footer-height); overflow-y: auto;}.footer{ position: fixed; bottom: 0; width: 100%; line-height: var(--footer-height); background: #42b983; color: #fff;}</style>

【增加需求】增加一個A邏輯,當滿足A邏輯的時候,底部按鈕就不展示,其他情況則展示。新增一個Bool值(isShow)來判斷是否顯示底部按鈕,具體代碼如下:

<template> <div id='app'> <div class='main'> <img alt='Vue logo' src='http://www.leifengta.com.cn/bcjs/assets/logo.png'> <HelloWorld msg='Welcome to Your Vue.js App'/> <img alt='Vue logo' src='http://www.leifengta.com.cn/bcjs/assets/logo.png'> </div> <div v-if=’isShow’> <div class='footer-content'>這是固定在底部的按鈕</div> </div> </div></template><script>import HelloWorld from ’./components/HelloWorld.vue’export default { name: ’App’, components: { HelloWorld }, data() { return { isShow: true } },}</script><style>:root{ --footer-height: 50px;}body { padding: 0; margin: 0;}#app { font-family: Avenir, Helvetica, Arial, sans-serif; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-align: center; color: #2c3e50; margin-top: 60px;}.main { overflow-y: auto;}.footer { height: var(--footer-height);}.footer-content { position: fixed; bottom: 0; width: 100%; line-height: var(--footer-height); background: #42b983; color: #fff;}</style>

到此這篇關于Vue實現固定底部組件的示例的文章就介紹到這了,更多相關Vue 固定底部內容請搜索好吧啦網以前的文章或繼續瀏覽下面的相關文章希望大家以后多多支持好吧啦網!

標簽: Vue
相關文章:
主站蜘蛛池模板: 青娱乐在线视频免费观看 | 黄色三级在线视频 | 亚洲69av| 亚洲va韩国va欧美va | 成年免费视频黄网站在线观看 | 成人二区三区 | 亚洲免费天堂 | 丰满少妇一级 | 杨思敏毛片 | 日本亚洲国产 | 日韩永久 | 九九综合网 | 99爱免费视频 | 日韩av免费播放 | 玖玖玖影院| 黄视频在线播放 | 国产视频在线一区 | 99视频导航 | 国产无遮挡又黄又爽免费网站 | 久久视频在线 | 色妇网| 日韩网站视频 | 日韩欧美在线免费 | 色婷婷综合网 | 成人在线视频网址 | 女人的天堂网 | aaa一级片 | 男女激情视频在线观看 | 日韩精品成人一区 | 欧美aaa级片 | 蜜桃精品在线观看 | 亚洲午夜网站 | 国产精品1024 | www网站在线观看 | 黑人巨大精品欧美一区二区 | 91亚洲网 | 九九热视频这里只有精品 | 一级片黑人 | 国产成人精 | 亚洲欧美视频在线观看 | 在线观看无遮挡 |