Closed spurdow closed 8 years ago
I dont understand why it wont work, using vueify , lodash , my button is gone
vueify
lodash
here is my signin.vue:
<style lang="sass"> $width: 600px; #signin { width: $width; margin: 1em auto; } </style> <template> <validator name="uvalidation"> <form v-on:submit="signin" id="signin"> <div class="form-group"> <label for="email" class="control-label">Email</label> <input type="email" v-model="email" id="email" class="form-control" placeholder="Enter Email Address" autofocus v-validate:email="['required']" /> </div> <div class="form-group"> <label for="password" class="control-label">Password</label> <input type="password" v-model="password" id="password" class="form-control" placeholder="Enter Password" v-validate:password="['required']"/> </div> <div class="errors"> <p v-if="$uvalidation.username.required">Required your name.</p> <p v-if="$uvalidation.comment.maxlength">Your comment is too long.</p> </div> <button type="submit" class="btn btn-default" v-if="$uvalidation.valid">Login</button> </form> </validator> </template> <script> const pick = require('lodash/pick'); module.exports = { // must be a function to be reusable data() { return { email: '', password: '' }; }, // methods methods: { signin() { alert('test'); var data = pick(this, ['email', 'password']); return data; } } }; </script>
Yes! Sorry, poor documentation. You can put the novalidate at form tag.
novalidate
form
Is it possible if i put it inside 'method' 'signin'?
I dont understand why it wont work, using
vueify
,lodash
, my button is gonehere is my signin.vue: