element-ui 密碼復雜度表單驗證


rules: {
    account: [{
            required: true,
            message: '請輸入用戶名',
            trigger: 'blur'
        }, {
            min: 2,
            max: 25,
            message: '長度在 4 到 25 個字符'
        }, {
            pattern: /^[\u4E00-\u9FA5]+$/,
            message: '用戶名只能為中文'
        }
        // { pattern:/^[a-zA-Z]w{5,17}$/, message: '以字母開頭,長度在6-18之間, 只能包含字符、數字和下划線'}
    ],
    password: [{
        required: true,
        message: '請輸入密碼',
        trigger: 'blur'
    }, {
        min: 6,
        max: 30,
        message: '長度在 6 到 30 個字符'
    }, {
        pattern: /^(\w){6,20}$/,
        message: '只能輸入6-20個字母、數字、下划線'
    }]
},


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM