SHARE
TWEET

Untitled

a guest Aug 19th, 2019 188 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // with v-model
  2. <input v-model="email" class="form-input" placeholder="you@example.com">
  3.  
  4. // without v-model
  5. <input :value="email" @input="email = $event.target.value" class="form-input" placeholder="you@example.com">
  6.  
  7. data() {
  8.   return {
  9.     email: 'test@test.com'
  10.   }
  11. }
  12.  
  13. // Controlled Componenet
  14.     - The value, or state, of the input is controlled by the parent
  15.     - A component that doesn't have any of its own state, but is controlled by state in the parent
  16.     - it communicates with the parent by firing events anytime the user has tried to change the value of the component
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top