Skip to main content
removed "Drupal" from the title
Link
avpaderno
  • 97.9k
  • 15
  • 164
  • 284

How to add Vue.js validation attributes to Drupal's input elements?

Bumped by Community user
Source Link

How to add Vue.js validation attributes to Drupal's input elements?

I've seen a tutorial about enhancing Drupal's elements using Vue.js validation component. The input markup is like this:

<input class="username form-text required" autocapitalize="none" type="text" id="edit-name" name="name" value="" size="60" maxlength="60" v-model="name" v-validate.initial="name" data-rules="required|alpha|min:3"> 
<input type="text" id="edit-mail" name="mail" value="" size="60" maxlength="254" class="form-text required" v-model="mail" v-validate.initial="email" data-rules="required|email">

But how do I add the Vue.js custom attributes to these input field?