更新记录

1.0.1(2023-06-19)

增加使用说明

1.0.0(2023-06-19)

插件初始化


平台兼容性

Vue2 Vue3
App 快应用 微信小程序 支付宝小程序 百度小程序 字节小程序 QQ小程序
HBuilderX 3.7.0 app-vue app-nvue
钉钉小程序 快手小程序 飞书小程序 京东小程序
H5-Safari Android Browser 微信浏览器(Android) QQ浏览器(Android) Chrome IE Edge Firefox PC-Safari

使用方法


<!-- 提示框 -->
<cc-defineDialogBox ref="DialogBox"></cc-defineDialogBox>

        // 显示询问弹框
            showDialogBox() {

                this.$refs['DialogBox'].confirm({
                    title: '请确认您填写的手机号',
                    content: '手机号码:13999999999?',
                    DialogType: 'inquiry',
                    animation: 0
                }).then((res)=>{

                    console.log('res = ', JSON.stringify(res));
                })
            },

            // 显示输入弹框
            showDialogBoxInput() {

                this.$refs['DialogBox'].confirm({
                                    title: '更改昵称',
                                    placeholder: '请输入修改的昵称',
                                    value: this.nickname,
                                    DialogType: 'input',
                                    animation: 0
                                }).then((res)=>{
                                    // 输入框返回值res
                                    this.nickname = res.value;
                                })
            },

HTML代码实现部分


<template>
    <view class="content">

        <!-- 提示框 -->
        <cc-defineDialogBox ref="DialogBox"></cc-defineDialogBox>

        <!-- 显示询问弹框 -->
        <button @click="showDialogBox"
            style="width: 160px; height: 50px;background-color: antiquewhite; margin-top: 26px;">显示询问弹框</button>

        <!-- 显示输入弹框 -->
        <button @click="showDialogBoxInput"
            style="width: 160px; height: 50px;background-color: antiquewhite; margin-top: 26px;">显示输入弹框</button>

    </view>
</template>

<script>
    export default {
        data() {
            return {
                nickname: 'Hello'
            }
        },
        onLoad() {

        },
        methods: {

            // 显示询问弹框
            showDialogBox() {

                this.$refs['DialogBox'].confirm({
                    title: '请确认您填写的手机号',
                    content: '手机号码:13999999999?',
                    DialogType: 'inquiry',
                    animation: 0
                }).then((res) => {

                    console.log('res = ', JSON.stringify(res));
                })
            },

            // 显示输入弹框
            showDialogBoxInput() {

                this.$refs['DialogBox'].confirm({
                    title: '更改昵称',
                    placeholder: '请输入修改的昵称',
                    value: this.nickname,
                    DialogType: 'input',
                    animation: 0
                }).then((res) => {
                    // 输入框返回值res
                    this.nickname = res.value;
                })
            },

        }
    }
</script>

<style>
    .content {
        display: flex;
        flex-direction: column;

    }
</style>

隐私、权限声明

1. 本插件需要申请的系统权限列表:

2. 本插件采集的数据、发送的服务器地址、以及数据用途说明:

3. 本插件是否包含广告,如包含需详细说明广告表达方式、展示频率:

许可协议

MIT协议

使用中有什么不明白的地方,就向插件作者提问吧~ 我要提问