Home > Web Front-end > Vue.js > How to delete objects in vuejs

How to delete objects in vuejs

藏色散人
Release: 2021-10-26 11:15:57
Original
4651 people have browsed it

How to delete objects in vuejs: 1. Open the corresponding js code part; 2. Delete the object attributes through the "Vue.delete(this.namelist,'name');" code.

How to delete objects in vuejs

The operating environment of this article: Windows 7 system, Vue2.9.6, Dell G3 computer.

How to delete objects in vuejs?

Vue.delete() deletes the properties of the object:

Vue.delete( target, key )
Copy after login

 data : {
        namelist : {
           id : 1, 
           name : '叶落森'
        }       
}
Copy after login
// 删除name
delete this.namelist.name;//js方法
Vue.delete(this.namelist,'name');//vue方法
Copy after login

Recommended: "The latest 5 vue.js videos Tutorial selection

The above is the detailed content of How to delete objects in vuejs. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template