Commit aef638e6 authored by youjie's avatar youjie

no message

parent f855fe65
......@@ -11,7 +11,8 @@
<view class="studentsPopuImg">
<view class="studentsPopu-img-box flex">
<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-img flex">
<view>
......@@ -64,7 +65,16 @@
let methods = {
// 选中
clickChoose(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() {
......@@ -84,6 +94,10 @@
//监听属性数组
watch(() => props["courseStuList"], (newValue, oldValue) => {
if (newValue != oldValue && newValue && newValue.length > 0) {
let addList = function(arr) {
arr.forEach((item) => {item.state = false;})
}
addList(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