bill 2 vuotta sitten
vanhempi
commit
77b0fc4217
3 muutettua tiedostoa jossa 3 lisäystä ja 1 poistoa
  1. 1 1
      src/components/list/index.vue
  2. 1 0
      src/sdk/association.ts
  3. 1 0
      src/utils/watch.ts

+ 1 - 1
src/components/list/index.vue

@@ -9,7 +9,7 @@
     <ul class="content">
       <li 
         v-for="(item, i) in data" 
-        :key="key ? item[key] : i" 
+        :key="(item as any)['raw']?.id"
         :class="{select: item.select}"
         @click="$emit('changeSelect', item)"
       >

+ 1 - 0
src/sdk/association.ts

@@ -87,6 +87,7 @@ const associationModels = (sdk: SDK) => {
     const stopLoadedWatch = watch(
       () => item.loaded,
       (loaded) => {
+        console.log("join", item)
         if (loaded) {
           const modelShow = getModelShowVariable(item)
           watchEffect(() => {

+ 1 - 0
src/utils/watch.ts

@@ -31,6 +31,7 @@ export const arrayChildEffectScope = <T extends any[]>(
   const scopes = new WeakMap<T, EffectScope>()
   shallowWatchArray(getItems, (newItems, oldItems) => {
     const { added, deleted } = diffArrayChange(newItems, oldItems)
+    console.log(added, deleted)
     for (const addItem of added) {
       const scope = effectScope()
       scope.run(() => {