Kaynağa Gözat

fix: 搜索框监听diff watch函数params顺序调整

xyh 2 yıl önce
ebeveyn
işleme
f13f3f645b
1 değiştirilmiş dosya ile 2 ekleme ve 2 silme
  1. 2 2
      src/components/filter/group/index.vue

+ 2 - 2
src/components/filter/group/index.vue

@@ -46,7 +46,7 @@ const toolList = computed(function() {
 });
 
 const formState = inject(props.providerKey) as Record<string, any>;
-watch(toolList, function(oldValue, newValue) {
+watch(toolList, function(newValue, oldValue) {
   /**
    * 新元素如果有缺少的需要将缺少的内容初始化数据
    *
@@ -63,7 +63,7 @@ watch(toolList, function(oldValue, newValue) {
    * 以上情况不触重置查询
    */
 
-  const diffEls = differenceBy(newValue, oldValue, 'id');
+  const diffEls = differenceBy(oldValue, newValue, 'id');
 
   if (diffEls.length) {
     diffEls.forEach(function({type, name}) {