uni-app彈窗的使用

1、u-popup
只是一個彈出層,如何實現(xiàn)全看自己
參考:Popup 彈出層 | uView - 多平臺快速開發(fā)的UI框架 - uni-app UI框架

u-popup

<u-popup v-model="appear" mode="center" length="90%" :closeable="true" border-radius="20"></u-popup>

2、uni-app組件
該組件在ios小程序中無法顯示確定和取消的按鈕的文字。

                        uni.$showModal.dialog({
                            _this: this,
                            title: '獲取定位失敗',
                            content: err.errCode == 2 || err.errMsg.indexOf('fail auth deny') >
                                -1 ?
                                '請打開手機定位功能' : '請開啟地理位置授權(quán)',
                            confirmText: err.errCode == 2 || err.errMsg.indexOf(
                                    'fail auth deny') > -
                                1 ? '好的' : '重新獲取',
                            cancelColor: 'black',
                            confirmColor: 'black',
                            success: (res) => {
                                let status = true
                                status = res.confirm && !err.errCode
                                if (status) {
                                    uni.openSetting({
                                        scope: 'scope.userLocation',
                                        success: (res) => {
                                            this.chooseLocation()
                                        },
                                        fail: () => {}
                                    })
                                }
                            },
                            fail: () => {}
                        })

3、u-model
參考:Modal 模態(tài)框 | uView - 多平臺快速開發(fā)的UI框架 - uni-app UI框架

<template>
    <view>
        <u-modal v-model="show" :content="content"></u-modal>
        <u-button @click="open">
            打開模態(tài)框
        </u-button>
    </view>
</template>
    
<script>
    export default {
        data() {    
            return {
                show: false,
                content: '東臨碣石,以觀滄海'
            }
        },
        methods: {
            open() {
                this.show = true;
            }
        }
    }
</script>
最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。