亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

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

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

子組件

<template>
    <div class="bottom-modal" :class="{'show': showModal}">
      <div class="modal-content" :class="{'show': showModal}">
        <!-- 內(nèi)容區(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;
    // 內(nèi)容顯示在底部
    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>請(qǐng)選擇取消訂單的原因:</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>商品信息填錯(cuò)了</text>
                        <radio :value="3" style="transform: scale(0.6)" />
                    </label>
                </view>
                <view>
                    <label class="item">
                        <text>地址信息填寫錯(cuò)誤</text>
                        <radio :value="4" style="transform: scale(0.6)" />
                    </label>
                </view>
                <view>
                    <label class="item">
                        <text>商品降價(jià)</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">確認(rèn)</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>

效果圖

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

相關(guān)文章

  • 關(guān)于同時(shí)使用swiper和echarts遇到的問題及解決方法

    關(guān)于同時(shí)使用swiper和echarts遇到的問題及解決方法

    這篇文章主要介紹了關(guān)于同時(shí)使用swiper和echarts遇到的問題及解決方法,本文給大家介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或工作具有一定的參考借鑒價(jià)值,需要的朋友可以參考下
    2023-04-04
  • 微信用戶訪問小程序的登錄過程詳解

    微信用戶訪問小程序的登錄過程詳解

    這篇文章主要介紹了微信用戶訪問小程序的登錄過程詳解,文中通過示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧
    2019-09-09
  • JavaScript實(shí)現(xiàn)圖片放大鏡效果

    JavaScript實(shí)現(xiàn)圖片放大鏡效果

    這篇文章主要為大家詳細(xì)介紹了JavaScript實(shí)現(xiàn)圖片放大鏡效果,文中示例代碼介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下
    2019-06-06
  • 一個(gè)原生的用戶等級(jí)的進(jìn)度條

    一個(gè)原生的用戶等級(jí)的進(jìn)度條

    做了一個(gè)用戶等級(jí)的進(jìn)度條,只是練手。
    2010-07-07
  • JavaScript 數(shù)組- Array的方法總結(jié)(推薦)

    JavaScript 數(shù)組- Array的方法總結(jié)(推薦)

    下面小編就為大家?guī)硪黄狫avaScript 數(shù)組- Array的方法總結(jié)(推薦)。小編覺得挺不錯(cuò)的,現(xiàn)在就分享給大家,也給大家做個(gè)參考。一起跟隨小編過來看看吧
    2016-07-07
  • js阻止默認(rèn)瀏覽器行為與冒泡行為的實(shí)現(xiàn)代碼

    js阻止默認(rèn)瀏覽器行為與冒泡行為的實(shí)現(xiàn)代碼

    下面小編就為大家?guī)硪黄猨s阻止默認(rèn)瀏覽器行為與冒泡行為的實(shí)現(xiàn)代碼。小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,也給大家做個(gè)參考。一起跟隨小編過來看看吧
    2016-05-05
  • H5實(shí)現(xiàn)手機(jī)拍照和選擇上傳功能

    H5實(shí)現(xiàn)手機(jī)拍照和選擇上傳功能

    這篇文章主要為大家詳細(xì)介紹了H5實(shí)現(xiàn)手機(jī)拍照和選擇上傳功能,文中示例代碼介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下
    2019-12-12
  • 如何用純js實(shí)現(xiàn)返回頁(yè)面頂部功能

    如何用純js實(shí)現(xiàn)返回頁(yè)面頂部功能

    頁(yè)面返回頂部是在Web中常見的效果,在一個(gè)很長(zhǎng)的頁(yè)面中,頁(yè)面返回頂部按鈕可以方便用戶回到頁(yè)面的頂部,增強(qiáng)用戶體驗(yàn),這篇文章主要給大家介紹了關(guān)于如何用純js實(shí)現(xiàn)返回頁(yè)面頂部功能的相關(guān)資料,需要的朋友可以參考下
    2024-06-06
  • javaScript強(qiáng)制保留兩位小數(shù)的輸入數(shù)校驗(yàn)和小數(shù)保留問題

    javaScript強(qiáng)制保留兩位小數(shù)的輸入數(shù)校驗(yàn)和小數(shù)保留問題

    這篇文章主要介紹了javaScript強(qiáng)制保留兩位小數(shù)的輸入數(shù)校驗(yàn)和小數(shù)保留問題,非常不錯(cuò),具有一定的參考借鑒價(jià)值,需要的朋友參考下吧
    2018-05-05
  • 原生js實(shí)現(xiàn)輪播圖特效

    原生js實(shí)現(xiàn)輪播圖特效

    這篇文章主要為大家詳細(xì)介紹了原生js實(shí)現(xiàn)輪播圖特效,文中示例代碼介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下
    2020-05-05

最新評(píng)論