From a6451848c30ba130d833f8a6b7abdd61fd020a33 Mon Sep 17 00:00:00 2001 From: DongZeLiang <2746733890@qq.com> Date: Thu, 7 Mar 2024 10:50:11 +0800 Subject: [PATCH] =?UTF-8?q?=E5=95=86=E5=93=81=E5=85=B1=E6=9C=89=E5=85=83?= =?UTF-8?q?=E7=B4=A0=20=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/product/info/index.vue | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) 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); } },