[Vuejs]-Vue Vuelidate to validate unique value based on data from server

0👍

Seem like you miss the right way to write down methods

        form: {
            name: {
                required,
                isUnique : this.isUnique
            }
          }
        },
        methods: {
          isUnique = (value, vm) => {
            if (value === '') return true
            if (vm.names) return !vm.names.includes(value)
              return true
          }
        }

Leave a comment