Is it wrong for vue to deconstruct the assignment like this?

data is like this

data () {
    return {
      username: "",
      pw: "",
      pw2: ""
    }
}

then in a method of methods, is it wrong to deconstruct the assignment like this? this points to the current component. Can"t I print the username to show that it is empty

?
const {username, pw, pw2} = this
Jan.24,2022

this deconstruction can only be used in vue to obtain assignments that cannot be operated because it is a value

const {username, pw, pw2} = this

username = '123'//

if you're just using it for printing, maybe username is asynchronously assigned

.
this.username = ''
const {username, pw, pw2} = this
consloe.log(username) // 

has actually been deconstructed. It is empty because your initial value is empty. You can set a username value to see

.

is already an empty string. If you can't get it, it should be undefined


say what you need, what do you want to achieve

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3b9df-40835.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3b9df-40835.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?