Created
January 10, 2018 17:42
-
-
Save mornir/21c094f5f8cbd082a3daf8c4a4aac797 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//pass vm (name is up to you) to data function in order get access to the present vue instance in nested objects | |
data: vm => ({ | |
valid: true, | |
name: '', | |
email: '', | |
password: '', | |
confirmPassword: '', | |
// in a non nested object, 'this' is enough to access the properties in the data function | |
/* matchPassword2() { | |
return this.password === this.confirmPassword || 'Password do not match.' | |
}, */ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment