Last active
April 19, 2017 20:00
-
-
Save DawTaylor/b2672c10fd47341692863a381acb29e5 to your computer and use it in GitHub Desktop.
This file contains 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
<input type="password" id="pwd"> | |
<input type="checkbox" v-model="showPwd"> |
This file contains 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
data() { | |
return { | |
showPwd : false | |
} | |
}, | |
watch : { | |
showPwd : (showPwd) => { | |
const input = document.querySelector('#pwd') | |
input.setAttribute('type', (!this.showPwd) ? 'password' : 'text') | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment