vue使用過濾改變el-switch開關的狀態


 

需求:

每個小組只能有一個組長,當打開開關設置組長時候,其他的組長一列為否狀態

setupLeader(row, event){   
        console.log(row, event, '設置組長開關')
        this.$axios({
            method: 'get',
            url: this.saveThousandCheckGroupLeader,
            params:  {
                userId: row.userId,
                groupId: row.groupId
            }
        }).then((res) => { 
           let id = row.id;
           console.log(id);
           this.tableData.forEach(item => {
                if (row.userId == item.userId)  {
                    row.isLeader = item.isLeader;
                }
            });       
            this.tableData.filter((val) => {
                return val.id != row.id;
            })
            this.getCheckGroupUserExList();
        }) 
    },

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM