ElementUI登陆表单中常用的标签属性

ElementUI官网

为登陆框添加一个边角弧度

<style>
.className{
    /*设置div边边框角的弧度*/
    border-radius: 10px;
}
</style>

<el–input>标签常用属性

<!--使用prefix属性添加一个前缀图标-->
<el-input prefix-icon="el-icon-user-solid"></el-input>

<!--使用suffix-icon属性添加一个后缀图标-->
<el-input suffix-icon="el-icon-s-tools"><el-input>

<!--使用placeholder为输入框添加一个提示输入语
	show-password属性可以在密码框右边有一个查看密码的图标
--> 
<el-input placeholder="用户名"></el-input>
<el-input placeholder="密码" show-password></el-input>

<!--使用clearable使输入框右边有一个可清空的图标-->
<el-input clearable></el-input>

设置按钮样式

<!--使用style="width:100%"将按钮框与input框一样长,
	type="primary"属性设置按钮为蓝色,emsp;是一个中文宽度
-->
 <el-button style="width:100%"
 			type="primary"  
 			v-on:click="loginHandle" >&emsp;&emsp;</el-button>

登陆表单样例

   <div class="login-page">
        <div class="login-form">
            <el-form ref="loginForm" v-bind:model="dataForm" :rules="rules" class="el-fo">
                <h2>请登录</h2>
                <el-form-item prop="username">
                    <el-input v-model="dataForm.username" placeholder="用户名" prefix-icon="el-icon-user" clearable></el-input>
                </el-form-item>
                <el-form-item prop="password">
                    <el-input v-model="dataForm.password" placeholder="密码" show-password prefix-icon="el-icon-lock" clearable></el-input>
                </el-form-item>
                  <el-button type="primary" v-on:click="loginHandle">&emsp;&emsp;</el-button>
            </el-form>
        </div>
    </div>
<style scoped>
/**
    样式默认是所有组件共享(在所有页面都可以使用)
    如果样式需要私有化(仅能在当前页使用),在<style>上加一个属性scoped
 */
.login-page{
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    /*添加背景图*/
    background-image: url(~@/assets/bg.jpg);
    background-size: cover;
}
.login-form{/*对应下图的灰白色部分*/
    width:300px;
    background-color: beige;
    text-align: center;
    /*设置div边边的外边距*/
    margin: 100px auto;
    /*设置div边边的内边距*/
    padding: 10px 20px;
    /*设置div边边框角的弧度*/
    border-radius: 10px;
}
.el-fo{/*对应下图的绿色部分*/
    /*设置真实表单框的内边距*/
    padding: 10px 20px;
}
/*在ElementUI中每个标签也都有它自己的样式,样式类名为组件名称*/
.el-button{ /*按钮变宽*/
    width: 100%;
}
</style>

在这里插入图片描述

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值