Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- isCPF(){
- if (this.cpfOrCnpjField.length > 11) {
- return false
- }
- return true
- },
- hasErrorOnCPF() {
- if (this.isCPF) {
- let cpf = this.cpfOrCnpjField.replace(/\D/g, '');
- let isValidCpf = clientUtils.isValidCpf(cpf)
- if (isValidCpf) return false
- else return true
- } else {
- return false //retornar falso sempre que for um CNPJ
- }
- },
- hasErrorOnCNPJ() {
- if (!this.isCPF) {
- let cnpj = this.cnpjField.replace(/\D/g, '');
- let isValidCNPJ = clientUtils.isValidCnpj(cnpj)
- if (isValidCnpj) return false
- return true
- } else {
- return false //retornar falso sempre que for um CPF
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement