Created
August 10, 2020 14:51
-
-
Save PKTseng/ca7eac13e44e2a3d0262f0b4c81f28a2 to your computer and use it in GitHub Desktop.
textarea-pre+setMessage
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
<div id="app"> | |
<textarea @input="setMessage">{{message}}</textarea> | |
<pre>{{message}}</pre> | |
</div> |
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
new Vue({ | |
el:'#app', | |
data:{ | |
message: '', | |
}, | |
methods:{ | |
setMessage(e){ | |
this.message = e.target.value; | |
} | |
} | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment