diff --git a/src/views/product/info/index.vue b/src/views/product/info/index.vue index e3b250f..db91d99 100644 --- a/src/views/product/info/index.vue +++ b/src/views/product/info/index.vue @@ -219,7 +219,8 @@ :props="{'value': 'id', 'label': 'name'}" :options="categoryOptions"> - + + @@ -439,8 +440,7 @@ export default { this.getList(); }, methods: { - attributeCheckedFun(checkedValue) { - console.log(checkedValue) + attributeCheckedFun() { // attributeIdCheckedList -> attributeCheckedList 不在 // 1 -> ID 1 : attributeCheckedList[] -> 1 // 2 -> ID 3 : attributeCheckedList[1] -> 3 @@ -457,7 +457,8 @@ export default { // attributeIdCheckedList [3,5,9] : attributeCheckedList [3,5] -> [3,5,9] // attributeIdCheckedList [3,9] : attributeCheckedList [3,5,9] -> [3,9] // attributeCheckedList 集合 不在 attributeIdCheckedList 集合的元素,然后删除 - + let attributeChecked = this.attributeCheckedList.find(attributeChecked => this.attributeIdCheckedList.indexOf(attributeChecked.id) === -1); + this.attributeCheckedList.splice(this.attributeCheckedList.indexOf(attributeChecked), 1); } },