modal.uvue 1.3 KB
Newer Older
Y
yurj26 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
<template>
    <view>
        <page-head :title="title"></page-head>
        <view class="uni-padding-wrap uni-common-mt">
            <view class="uni-btn-v">
                <button class="uni-btn" type="default" @tap="modalTap">有标题的modal</button>
                <button class="uni-btn" type="default" @tap="noTitlemodalTap">无标题的modal</button>
            </view>
        </view>
    </view>
</template>
<script lang="ts">
    export default {
        data() {
            return {
                title: 'modal'
            }
        },
        methods: {
            modalTap: function () {
                uni.showModal({
                    title: "弹窗标题",
                    content: "弹窗内容,告知当前状态、信息和解决方法,描述文字尽量控制在三行内",
                    showCancel: false,
                    confirmText: "确定"
                })
            },
            noTitlemodalTap: function () {
                uni.showModal({
                    content: "弹窗内容,告知当前状态、信息和解决方法,描述文字尽量控制在三行内",
                    confirmText: "确定",
                    cancelText: "取消"
                })
            }
        }
    }
</script>