最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

uni-app封裝組件實現(xiàn)下方滑動彈出模態(tài)框效果

 更新時間:2024年08月03日 10:41:40   作者:專職  
這篇文章主要介紹了uni-app封裝組件實現(xiàn)下方滑動彈出模態(tài)框效果,本文通過實例代碼給大家介紹的非常詳細,對大家的學習或工作具有一定的參考借鑒價值,需要的朋友參考下吧

子組件

<template>
    <div class="bottom-modal" :class="{'show': showModal}">
      <div class="modal-content" :class="{'show': showModal}">
        <!-- 內容區(qū)域 -->
        <slot></slot>
      </div>
    </div>
  </template>
  <script>
  export default {
    name: 'BottomModal',
    props: {
      showModal: {
        type: Boolean,
        default: false
      }
    },
    methods: {
    }
  }
  </script>
  <style lang="scss">
  .bottom-modal {
    position: fixed;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 0;
    background-color: rgba(0, 0, 0, 0.5);
    overflow: hidden;
    transition: height 0.2s ease-out;
    z-index: 99;
  }
  .bottom-modal.show {
    height: 100%;
  }
  .modal-content {
    background-color: #fff;
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
    box-shadow: 0px -2px 10px rgba(0, 0, 0, 0.1);
    padding: 16px;
    // 內容顯示在底部
    position: absolute;
    left: 0;
    bottom: 0;
    box-sizing: border-box;
    width: 100%;
    z-index: 999;
    height: 0;
    transition: all 0.5s linear;
  }
  .modal-content.show {
    height: 60vh;
  }
  .modal-mask {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
  }
  </style>

父組件

<script>
import BottomModal from "@/components/BottomModal.vue"
export default {
    components: {
        BottomModal
    },
    data() {
		return {
		    showModal: false
		}
	},
	methods: {
        radioChange(e) {
            console.log("radioChange", e.detail.value)
        }
	}
}
</script>
<template>
    <bottom-modal :showModal="showModal">
        <view class="my-modal">
            <text class="title">訂單取消</text>
            <text>請選擇取消訂單的原因:</text>
            <radio-group @change="radioChange">
                <view>
                    <label class="item">
                        <text>商品無貨</text>
                        <radio :value="1" style="transform: scale(0.6)" />
                    </label>
                </view>
                <view>
                    <label class="item">
                        <text>不想要了</text>
                        <radio :value="2" style="transform: scale(0.6)" />
                    </label>
                </view>
                <view>
                    <label class="item">
                        <text>商品信息填錯了</text>
                        <radio :value="3" style="transform: scale(0.6)" />
                    </label>
                </view>
                <view>
                    <label class="item">
                        <text>地址信息填寫錯誤</text>
                        <radio :value="4" style="transform: scale(0.6)" />
                    </label>
                </view>
                <view>
                    <label class="item">
                        <text>商品降價</text>
                        <radio :value="5" style="transform: scale(0.6)" />
                    </label>
                </view>
                <view>
                    <label class="item">
                        <text>其它</text>
                        <radio :value="6" style="transform: scale(0.6)" />
                    </label>
                </view>
            </radio-group>
            <view class="cancel-confirm">
                <text @click="handleCancel">取消</text>
                <text @click="handleConfirm" class="confirm">確認</text>
            </view>
        </view>
    </bottom-modal>
</template>
<style lang="scss">
.my-modal {
    display: flex;
    flex-direction: column;
    font-size: 26rpx;
    .item {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-top: 30rpx;
        padding-right: 30rpx;
    }
    .title {
        margin-top: 15rpx;
        font-size: 30rpx;
        text-align: center;
    }
    .cancel-confirm {
        display: flex;
        justify-content: space-around;
        margin-top: 30rpx;
        text {
            width: 300rpx;
            height: 60rpx;
            line-height: 60rpx;
            text-align: center;
            border: 1px solid #e6e2e2;
            border-radius: 30rpx;
        }
        .confirm {
            background-color: #27BA9B;
            border: none;
            color: #fff;
        }
    }
}
</style>

效果圖

到此這篇關于uni-app封裝組件實現(xiàn)下方滑動彈出模態(tài)框的文章就介紹到這了,更多相關uni-app滑動彈出模態(tài)框內容請搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關文章希望大家以后多多支持腳本之家!

相關文章

  • Kindeditor單獨調用單圖上傳增加預覽功能的實例

    Kindeditor單獨調用單圖上傳增加預覽功能的實例

    下面小編就為大家?guī)硪黄狵indeditor單獨調用單圖上傳增加預覽功能的實例。小編覺得挺不錯的,現(xiàn)在就分享給大家,也給大家做個參考。一起跟隨小編過來看看吧
    2017-07-07
  • JS實現(xiàn)頁面加載完成之后自動刷新一次問題

    JS實現(xiàn)頁面加載完成之后自動刷新一次問題

    這篇文章主要介紹了JS實現(xiàn)頁面加載完成之后自動刷新一次問題,具有很好的參考價值,希望對大家有所幫助。如有錯誤或未考慮完全的地方,望不吝賜教
    2023-02-02
  • 微信小程序獲取用戶openid的方法詳解

    微信小程序獲取用戶openid的方法詳解

    小程序的openid相當重要,它是用戶的唯一標識id,牽扯的支付,登錄,授權等,下面這篇文章主要給大家介紹了關于微信小程序獲取用戶openid的相關資料,需要的朋友可以參考下
    2022-04-04
  • js實現(xiàn)無縫滾動圖

    js實現(xiàn)無縫滾動圖

    本文主要分享了js實現(xiàn)無縫滾動圖的示例代碼,具有很好的參考價值,下面跟著小編一起來看下吧
    2017-02-02
  • 詳解javascript replace高級用法

    詳解javascript replace高級用法

    這篇文章主要介紹了詳解javascript replace高級用法,文中通過示例代碼介紹的非常詳細,對大家的學習或者工作具有一定的參考學習價值,需要的朋友們下面隨著小編來一起學習學習吧
    2019-02-02
  • JavaScript遍歷查找數(shù)組中最大值與最小值的方法示例

    JavaScript遍歷查找數(shù)組中最大值與最小值的方法示例

    這篇文章主要介紹了JavaScript遍歷查找數(shù)組中最大值與最小值的方法,結合實例形式分析了javascript基于數(shù)組遍歷、判斷實現(xiàn)最大值與最小值計算的相關操作技巧,需要的朋友可以參考下
    2019-05-05
  • 深入理解JavaScript中的浮點數(shù)

    深入理解JavaScript中的浮點數(shù)

    下面小編就為大家?guī)硪黄钊肜斫釰avaScript中的浮點數(shù)。小編覺得挺不錯的,現(xiàn)在分享給大家,也給大家做個參考。一起跟隨小編過來看看吧
    2016-05-05
  • js實現(xiàn)3D照片墻效果

    js實現(xiàn)3D照片墻效果

    這篇文章主要介紹了js實現(xiàn)3D照片墻效果,文中示例代碼介紹的非常詳細,具有一定的參考價值,感興趣的小伙伴們可以參考一下
    2019-10-10
  • 給js文件傳參數(shù)(詳解)

    給js文件傳參數(shù)(詳解)

    這篇文章主要介紹了給js文件傳參數(shù)的方法,需要的朋友可以參考下
    2014-07-07
  • 淺談下拉菜單中的Option對象

    淺談下拉菜單中的Option對象

    Option 對象代表 HTML 表單中下拉列表中的一個選項。在 HTML 表單中 <option> 標簽每出現(xiàn)一次,一個 Option 對象就會被創(chuàng)建。您可通過表單的 elements[] 數(shù)組訪問一個 Option 對象,或者通過使用 document.getElementById()。
    2015-05-05

最新評論

洪湖市| 鸡西市| 惠水县| 松原市| 山阴县| 登封市| 商丘市| 苍山县| 即墨市| 武义县| 芦溪县| 萍乡市| 黔西| 舒兰市| 汪清县| 合作市| 东安县| 旌德县| 清镇市| 广宗县| 南通市| 陆良县| 故城县| 太湖县| 胶州市| 天柱县| 富蕴县| 洞口县| 皋兰县| 龙江县| 铅山县| 江陵县| 额尔古纳市| 兖州市| 手机| 巴楚县| 普安县| 德江县| 苍梧县| 敦煌市| 称多县|