codecamp

百度智能小程序 温馨提示

prompt 温馨提示

解释: 温馨提示组件,可配置标题内容,提示内容,并可放置在页面的任何位置。

属性说明

属性名 类型 必填 默认值 说明

prompt-class

String

提供开发外部样式类,供开发者自定义组件样式,可通过此 class 改变提示框外层样式

title-class

String

提供开发外部样式类,供开发者自定义组件样式,可通过此 class 改变提示框标题样式

content-class

String

提供开发外部样式类,供开发者自定义组件样式,可通过此 class 改变提示框内容样式

示例 

在开发者工具中打开


代码示例

<view class="wrap">
    <view class="container">
        <view class="card-panel">
            <view class="comp-wrap">
                <smt-prompt>
                    <view slot="title">标题名称</view>
                    <view slot="content">内容信息描述,支持多行信息展示,高度根据内容信息自适应</view>
                </smt-prompt>
            </view>
        </view>
        <view class="card-panel">
            <view class="comp-wrap">
                <smt-prompt content-class="prompt-content">
                    <view slot="title">标题名称</view>
                    <view slot="content">
                        内容信息描述,支持多行信息展示,高度根据内容信息自适应<view class="content-herf" bindtap="clkTextShow">文字链接</view>
                    </view>
                </smt-prompt>
            </view>
        </view>
    </view>
</view>
Page({

    /**
     * 文字链接点击事件
     */
    clkTextShow() {
        swan.showToast({
            title: '暂未配置链接',
            icon: 'none'
        });
    }
});
.wrap {
    height: 100vh;
}

.smt-card-area {
    margin-top: 25.36rpx;
}

.card-panel:first-child {
    margin-top: 0;
}

.card-area {
    display: flex;
    margin: 90.58rpx 0 0;
    padding: 28.382rpx 30.797rpx;
    border: none;
    border-radius: 0;
    transition: background-color 200ms linear;
    align-items: center;
    justify-content: space-between;
}

.comp-wrap {
    background-color: #fff;
    margin-top: 25.362rpx;
    padding: 27.174rpx 30.797rpx;
}

.prompt-content {
    font-size: 25.362rpx;
    line-height: 1.5;
    color: #999;
}

.prompt-content .content-herf {
    color: #2772fb;
    display: inline;
}
{
    "navigationBarTitleText": "温馨提示",
    "navigationStyle": "default",
    "usingComponents": {
        "smt-prompt": "@smt-ui/component/src/prompt"
    }
}


百度智能小程序 级联组件
百度智能小程序 跑马灯
温馨提示
下载编程狮App,免费阅读超1000+编程语言教程
取消
确定
目录

百度智能小程序开发文档

百度智能小程序 组件

百度智能小程序 地图

百度智能小程序 画布

百度智能小程序 API

百度智能小程序 界面

百度智能小程序 关注小程序引导组件

百度智能小程序 自定义组件

百度智能小程序 媒体

百度智能小程序 设备

百度智能小程序 拨打电话

百度智能小程序 内存警报

百度智能小程序 手机联系人

百度智能小程序 用户截屏事件

百度智能小程序 第三方平台

百度智能小程序 开放接口

百度智能小程序 百度收银支付

百度智能小程序 分包预下载

百度智能小程序 数据分析

百度智能小程序 服务端

百度智能小程序 云开发

百度智能小程序 初始化

百度智能小程序 云函数

百度智能小程序 服务端初始化

百度智能小程序 服务器获取上下文

百度智能小程序 服务端云函数

百度智能小程序 开发教程

百度智能小程序 功能开发

百度智能小程序 基本原理

百度智能小程序 小程序自动化

百度智能小程序 视频教程

关闭

MIP.setData({ 'pageTheme' : getCookie('pageTheme') || {'day':true, 'night':false}, 'pageFontSize' : getCookie('pageFontSize') || 20 }); MIP.watch('pageTheme', function(newValue){ setCookie('pageTheme', JSON.stringify(newValue)) }); MIP.watch('pageFontSize', function(newValue){ setCookie('pageFontSize', newValue) }); function setCookie(name, value){ var days = 1; var exp = new Date(); exp.setTime(exp.getTime() + days*24*60*60*1000); document.cookie = name + '=' + value + ';expires=' + exp.toUTCString(); } function getCookie(name){ var reg = new RegExp('(^| )' + name + '=([^;]*)(;|$)'); return document.cookie.match(reg) ? JSON.parse(document.cookie.match(reg)[2]) : null; }