zoukankan      html  css  js  c++  java
  • vue案例系列--【vue+Element ui 实现登录页面】

    <template>
        <div class="login-container">
            <el-form :model="ruleForm2" :rules="rules2"
             status-icon
             ref="ruleForm2" 
             label-position="left" 
             label-width="0px" 
             class="demo-ruleForm login-page">
                <h3 class="title">系统登录</h3>
                <el-form-item prop="username">
                    <el-input type="text" 
                        v-model="ruleForm2.username" 
                        auto-complete="off" 
                        placeholder="用户名"
                    ></el-input>
                </el-form-item>
                    <el-form-item prop="password">
                        <el-input type="password" 
                            v-model="ruleForm2.password" 
                            auto-complete="off" 
                            placeholder="密码"
                        ></el-input>
                    </el-form-item>
                <el-checkbox 
                    v-model="checked"
                    class="rememberme"
                >记住密码</el-checkbox>
                <el-form-item style="100%;">
                    <el-button type="primary" style="100%;" @click="handleSubmit" :loading="logining">登录</el-button>
                </el-form-item>
            </el-form>
        </div>
    </template>
    
    <script>
    export default {
        data(){
            return {
                logining: false,
                ruleForm2: {
                    username: 'admin',
                    password: '123456',
                },
                rules2: {
                    username: [{required: true, message: 'please enter your account', trigger: 'blur'}],
                    password: [{required: true, message: 'enter your password', trigger: 'blur'}]
                },
                checked: false
            }
        },
        methods: {
            handleSubmit(event){
                this.$refs.ruleForm2.validate((valid) => {
                    if(valid){
                        this.logining = true;
                        if(this.ruleForm2.username === 'admin' && 
                           this.ruleForm2.password === '123456'){
                               this.logining = false;
                    
    

      

  • 相关阅读:
    MVC3+Spring.net+NHibernate+ExtJs的简单架构
    WCF初见之Salt+Hash加密
    演讲时经常用到的几个小工具介绍
    2asp.net mvc 4 in action
    Hadoop简介和实践分享
    PyMongo非关系型数据库mongodb入门
    网络资源定位(Url)的奥秘
    ApplicationPoolIdentity
    CustomBehavior 入门
    架构培训
  • 原文地址:https://www.cnblogs.com/chenhaiyun/p/14772745.html
Copyright © 2011-2022 走看看