0

I am currently using vee-validate in my project with it's validation observer.

For example, I got vee-validate working with an input like blow:

  <ValidationProvider
    :name="fieldName"
    :rules="rules"
    v-slot="{ errors }"
    :customMessages="error"
    :vid="name"
  >
   <input
      class="form-control"
      :class="{ 'is-invalid': errors.length }"
      :name="name"
      :inputmode="type"
      :id="id"
      :placeholder="placeholder"
      tabindex="1"
      v-model="input"
      @blur="onBlur"
      @focus="onFocus"
      @input="$emit('input', $event.target.value)"
    />
    <p class="veeValidatorError">{{ errors[0] }}</p>
  </ValidationProvider>
</template>

Does anyone have an idea how I can do something similar but instead of the input field I would like to use vue2-editor like below

  <ValidationProvider :name="fieldName" :rules="rules" v-slot="{ errors }" :customMessages="error" :vid="name">
    <vue-editor  v-model="content" :editorToolbar="customToolbar"></vue-editor>
    <p class="veeValidatorError">{{ errors[0] }}</p>
  </ValidationProvider>
</template>

1 Answer 1

1

my solution is based on only show error on validation.

        <validation-provider
          v-slot="{ errors }"
          name="Text"
          rules="required"
        >
            <vue-editor
              v-model="content"
              :editorToolbar="customToolbar"
            />
            <p v-if="errors[0] && errors[0].length > 0">
              {{ errors[0] }}
            </p>
        </validation-provider>
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.