Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the method of assigning Object.assign ({}, row) to objects in vue

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces the vue object assignment Object.assign ({}, row) way is what the relevant knowledge, the content is detailed and easy to understand, simple and fast operation, has a certain reference value, I believe you will get something after reading this vue object assignment Object.assign ({}, row) way article, let's take a look at it.

Object.assign ({}, row) assigned to the object

Copy function. If you want to remove id without passing it, set the local variable and assign the entire row object to the newData variable, using Object.assign ({}, row); use the delete method to delete id in newData

CopyStep (index,row) {/ / assign the object to a variable let newData = Object.assign ({}, row) delete newData.id passes the processed variable to the following two methods this.addStep (index,newData); this.showEditDialog (index + 1) newDataLines true);}, a small knowledge point that Object.assign () needs to pay attention to

What if the original object changes when object.assign () is used?

As shown in the figure, the original object obj will also change. If you do not want the original object obj to change, you can use the following method. If the first parameter passed in is empty, the original object will not change.

This is the end of the article on "how Object.assign ({}, row) objects are assigned in vue". Thank you for reading! I believe that everyone has a certain understanding of the knowledge of "what is the way of assigning Object.assign ({}, row) to objects in vue". If you want to learn more knowledge, welcome to follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report