Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <template>
- <form @submit.prevent="validation()">
- <username v-model="username" v-bind="isValidUsername"/>
- <password v-model="password" v-bind="isValidPassword"/>
- </form>
- </template>
- <script>
- import Username from 'Username.vue'
- import Password from 'Password.vue'
- export default {
- components: {
- Username,
- Password
- },
- data () {
- return {
- username: '',
- isValidUsername: true,
- password: '',
- isValidPassword: true
- }
- },
- methods: {
- validation () {
- this.isValidUsename = !!this.username
- this.isValidPassword = !!this.password
- }
- }
- }
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement