save username
This commit is contained in:
parent
e525b83cfb
commit
98ddaf519d
@ -100,6 +100,7 @@ export default {
|
|||||||
setUsername(e){
|
setUsername(e){
|
||||||
if (this.username.trim().length > 0){
|
if (this.username.trim().length > 0){
|
||||||
this.didSetUsername = true
|
this.didSetUsername = true
|
||||||
|
localStorage.setItem('username', this.username)
|
||||||
this.$socket.emit('set_username', this.username)
|
this.$socket.emit('set_username', this.username)
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
}
|
}
|
||||||
@ -124,7 +125,11 @@ export default {
|
|||||||
init() {
|
init() {
|
||||||
location.reload();
|
location.reload();
|
||||||
},
|
},
|
||||||
}
|
},
|
||||||
|
mounted() {
|
||||||
|
if (localStorage.getItem('username'))
|
||||||
|
this.username = localStorage.getItem('username')
|
||||||
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user