• Vue:uni-app学习(六)--表单组件


    Vue:uni-app学习(六)--表单组件

    <template>
        <view>
    
        </view>
    </template>
    
    <script>
        export default {
            data() {
                return {
                    
                };
            }
        }
    </script>
    
    <style lang="scss">
    
    </style>
    <template>
        <view class="content">
            <form @submit="formSubmit" @reset="formReset">
                <view class="box">
                    <view class="title">用户名:</view>
                    <input type="text" name="user" placeholder="请输入用户名" />
                </view>
                
                <view class="box">
                    <view class="title">密码:</view>
                    <input type="password" name="user" placeholder="请输入密码" />
                </view>
                
                <view class="box">
                    <view class="title">性别:</view>
                    <radio-group name="gender">
                        <label>
                            <radio value="" /><text>男</text>
                        </label>
                        <label>
                            <radio value="" /><text>女</text>
                        </label>
                    </radio-group>
                </view>
                
                <view class="box">
                    <view class="title">爱好:</view>
                    <checkbox-group name="loves">
                        <label>
                            <checkbox value="读书" /><text>读书</text>
                        </label>
                        <label>
                            <checkbox value="写字" /><text>写字</text>
                        </label>
                    </checkbox-group>
                </view>
                
                <view class="box">
                    <view class="title">年龄:</view>
                    <slider value="20" name="age" show-value></slider>
                </view>
                
                <view class="box">
                    <view class="title">保留选项:</view>
                    <switch name="switch" />
                </view>
    
                <view class="row">
                    <button type="default" form-type="submit">提交</button>
                    <button type="default" form-type="reset">重置</button>
                </view>
    
            </form>
        </view>
    </template>
    
    <script>
        export default {
            data() {
                return {
    
                }
            },
            methods: {
                formSubmit() {
                    alert(33)
                },
                formReset() {
                    uni.showToast({
                        title: "清除成功!",
                        icon: "none"
                    });
                }
            }
        }
    </script>
    
    <style lang="scss">
        .content {
            display: flex;
            flex-direction: column;
            margin-top: 30rpx;
            background-color: $uni-bg-color-grey;
             690rpx;
            padding: 20rpx 30rpx;
            font-size: 18px;
            line-height: 1.8;
    
            .box {
                margin-bottom: 40rpx;
    
                .title {
    
                    margin-bottom: 20px;
                }
    
                input {
                    background-color: white;
                    border-radius: 5px;
                }
            }
    
            .row {
                display: flex;
                flex-direction: row;
                justify-content: space-evenly;
            }
        }
    </style>
  • 相关阅读:
    android手机rootROM下载地址
    mysql alter 语句用法,添加、修改、删除字段等
    java比较两个日期大小
    eclipse设置全局编码为UTF-8的方法
    Spring MVC 异步处理请求,提高程序性能
    ELK(ElasticSearch, Logstash, Kibana)搭建实时日志分析平台
    maven之发布项目到nexus【clean deploy命令】
    nexus-3本地下载jar的settipng.xml配置
    windows开启3306端口并用可视化工具访问远程mysql(授权访问)
    mysql 列转行,合并字段
  • 原文地址:https://www.cnblogs.com/wukong1688/p/13485398.html
Copyright © 2020-2023  润新知