Return all data when the search condition is empty?

use the local array as data to realize the search function. Query according to the condition when the condition is available, and return all data when the condition is empty
this.users: local object array

search() {
          console.log("search")
         this.query = this.$refs.search.value;
          if (this.query === "") {
               this.$message({
                    showClose: true,
                    message: "",
                    type: "warning"
                });
                // this.users = this.user
                this.users = Object.assign({},this.user)
          } else {
               this.$message({
                    showClose: true,
                    message: ":",
                    type: "success"
                });
                let result = []
                result = this.users.filter(item => {
                    return item.name === this.query
                })
                this.users = result 
            }
      },
      

clipboard.png
now that the search condition is empty and no data is returned, how to modify it?

Aug.24,2021

if (this.query ='') {

   this.$message({
        showClose: true,
        message: '',
        type: 'warning'
    });
  return 

}


this.users = result this.users has been modified.
this.users = Object.assign ({}, this.user) what is this.user?

Menu