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

How to traverse the display and concealment of form action buttons in vue form

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

Share

Shulou(Shulou.com)05/31 Report--

This article mainly introduces "how to traverse the display and hiding of the form operation button in the vue form". In the daily operation, I believe that many people have doubts about how to traverse the form operation button in the vue form. Xiaobian consulted all kinds of data and sorted out simple and easy-to-use operation methods. I hope it will be helpful to answer the doubt of "how to traverse the form operation button in the vue form". Next, please follow the editor to study!

1. The first step is to define the array in data

Data () {return {passSaveShow: [], / / Show Hidden passEditShow: [], / / Show Hidden checkedUnLink of access Group Editing: [], / / unassociate whether valDate: [], / / validity shows pickDateShow: [], / / date plug-in hides linkedValue: [], showImg: false / / whether to enlarge the image imgSrc:'', / / the path of the picture checkName:'', / / enter the name keywords checked: false, checkLists: [], checkPage: {page: 1, count: 2, total: 0}} }

two。 Use in the page

3. The important step is to push into the array

/ / initialize the load data mounted () {let groupId= this.$props.perGroupInfo.id; let page= 1; let count= this.checkPage.count; let expired= 0; console.log (groupId); let url = `api/groupemp/linked?page=$ {page} & count=$ {count} & groupId=$ {groupId} & expired=$ {expired} `; this.$https.get (url) .then (res = > {console.log ('View initialization data'); console.log (res); console.log (res.data.data) Console.log ('View initialization tail'); this.checkLists = res.data.data; this.checkPage.total = res.data.Total; this.checkLists.forEach ((item, index) = > {this.valDate.push (true); this.pickDateShow.push (false); this.passSaveShow.push (false); this.passEditShow.push (true);}) .catch (err = > {console.log ('View initialization data error')) Console.log (err);})

4. Change the display of buttons hidden, using splice, can not be changed directly

/ / modify the validity period editValDate (val) {this.passEditShow.splice (val, 1, false); this.passSaveShow.splice (val, 1, true); this.valDate.splice (val, 1, false); this.pickDateShow.splice (val, 1, true); / / console.log (this.valDate [Val]); / / console.log (this.pickDateShow [Val]) At this point, the study on "how to traverse the display and hiding of form action buttons in a vue form" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

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

Internet Technology

Wechat

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

12
Report