Commit aef638e6 authored by youjie's avatar youjie

no message

parent f855fe65
...@@ -11,7 +11,8 @@ ...@@ -11,7 +11,8 @@
<view class="studentsPopuImg"> <view class="studentsPopuImg">
<view class="studentsPopu-img-box flex"> <view class="studentsPopu-img-box flex">
<template v-for="(item,index) in stuList"> <template v-for="(item,index) in stuList">
<view class="studentsPopu-img-list active flex" @click="clickChoose(item)"> <view class="studentsPopu-img-list flex" @click="clickChoose(item)"
:class="item.state?'active':''">
<view class="studentsPopu-imgbox flex"> <view class="studentsPopu-imgbox flex">
<view class="studentsPopu-img flex"> <view class="studentsPopu-img flex">
<view> <view>
...@@ -64,7 +65,16 @@ ...@@ -64,7 +65,16 @@
let methods = { let methods = {
// 选中 // 选中
clickChoose(item) { clickChoose(item) {
data.chooseStuArray.push(item); item.state = !item.state
if(item.state){
data.chooseStuArray.push(item);
}else{
data.chooseStuArray.forEach((i,index)=>{
if(i.StuId==item.StuId){
data.chooseStuArray.splice(index,1)
}
})
}
}, },
// 搜索 // 搜索
searchKeywords() { searchKeywords() {
...@@ -84,6 +94,10 @@ ...@@ -84,6 +94,10 @@
//监听属性数组 //监听属性数组
watch(() => props["courseStuList"], (newValue, oldValue) => { watch(() => props["courseStuList"], (newValue, oldValue) => {
if (newValue != oldValue && newValue && newValue.length > 0) { if (newValue != oldValue && newValue && newValue.length > 0) {
let addList = function(arr) {
arr.forEach((item) => {item.state = false;})
}
addList(newValue);
data.stuList = newValue; data.stuList = newValue;
} }
}, { }, {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment