Home  >  Article  >  Web Front-end  >  How to delete attributes in vuejs

How to delete attributes in vuejs

藏色散人
藏色散人Original
2021-09-21 16:14:234897browse

In vuejs, you can delete the properties of an object through "Vue.delete(target, key)". The specific method of deleting properties is such as "Vue.delete(this.namelist,'name');".

How to delete attributes in vuejs

The operating environment of this article: Windows 7 system, Vue version 2.9.6, Dell G3 computer.

How to delete attributes in vuejs?

Vue.delete() deletes the properties of the object

Vue.delete( target, key )

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

Recommended learning: "vue tutorial"

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

Statement:
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
Previous article:How to set title in vuejsNext article:How to set title in vuejs