zoukankan      html  css  js  c++  java
  • 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>
  • 相关阅读:
    Redis 外网无法访问
    设计模式单例模式
    网易笔试问答(20210328)新生代转移到老年代的情况
    网易笔试(20210327)最长摇摆子数组长度
    网易笔试(20210327)吉利数(子数组中数组和为6的倍数的最大子数组和)
    360笔试(20210328)射气球
    解决TFS 错误:[TF15013 请求的 Team Foundation Server 未向代理服务器注册]
    TFS 常用命令
    生成安全的用于加密的随机数
    一种新的验证码(改进版)
  • 原文地址:https://www.cnblogs.com/wukong1688/p/13485398.html
Copyright © 2011-2022 走看看