微信小程序 WeUIFormPage


本文整理自网络,侵删。

FormPage

表单页面,规定了标准表单的顶部的标题和底部的按钮提示等区域的规范

代码引入

在 page.json 中引入组件

{
  "usingComponents": {
    "mp-form-page": "../../components/form-page/form-page",
    "mp-form": "../../components/form/form"
  }
}

示例代码

<!--WXML示例代码-->
<mp-form-page title="表单结构" subtitle="展示表单页面的信息结构样式, 分别由头部区域/控件区域/提示区域/操作区域和底部信息区域组成。">
    <mp-form id="form" rules="{{rules}}" models="{{formData}}">
    </mp-form>
    <checkbox-group slot="tips" bindchange="bindAgreeChange">
        <label class="weui-agree" for="weuiAgree">
            <view class="weui-agree__text">
                <checkbox class="weui-agree__checkbox" id="weuiAgree" value="agree" checked="{{isAgree}}" />
                <view class="weui-agree__checkbox-icon">
                    <icon class="weui-agree__checkbox-icon-check" type="success_no_circle" size="9" wx:if="{{isAgree}}"></icon>
                </view>
                阅读并同意<navigator url="" class="weui-agree__link">《相关条款》</navigator>
            </view>
        </label>
    </checkbox-group>
    <view slot="button">
        <button class="weui-btn" type="primary" bindtap="submitForm">确定</button>
    </view>
</mp-form-page>

效果展示

属性列表

属性类型默认值必填说明
titlestring标题
subtitleboolean副标题

Slot

名称描述
title标题区域slot和title属性互斥
tips底部确认按钮前面的提示区域
button底部提交按钮区域
suffixtips提交按钮下面的提示区域
footer页脚的内容区域



标签:微信小程序

相关阅读 >>

微信小程序 用户信息-获取手机号

微信小程序api 视频解码器-videodecoder实例

微信小程序 图片智能裁剪能力

微信小程序 插件服务微信同声传译

微信小程序 小程序使用updateprinter

微信小程序api 背景音频-暂停播放

微信小程序api 绘图globalcompositeoperation

微信小程序内容组件图标 icon

微信小程序api 音频-暂停播放

微信小程序api 绘图clearrect(在给定的矩形区域内,清除画布上的像素)

更多相关阅读请进入《微信小程序》频道 >>




打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...