Created
January 10, 2018 17:42
-
-
Save mornir/b1fc35a6c06f931eaa59a6789d032041 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