Parcourir la source

fix: 替换 buble 不支持的 ?? 和 ?. 语法

simonlll il y a 1 semaine
Parent
commit
263410a424
1 fichiers modifiés avec 2 ajouts et 2 suppressions
  1. 2 2
      src/pages/ai-chat/index.vue

+ 2 - 2
src/pages/ai-chat/index.vue

@@ -75,7 +75,7 @@
75
                   <text v-for="col in msg.columns" :key="col" class="th">{{ col }}</text>
75
                   <text v-for="col in msg.columns" :key="col" class="th">{{ col }}</text>
76
                 </view>
76
                 </view>
77
                 <view v-for="(row, ri) in msg.rows" :key="ri" :class="['table-row', ri % 2 === 0 ? 'even' : '']">
77
                 <view v-for="(row, ri) in msg.rows" :key="ri" :class="['table-row', ri % 2 === 0 ? 'even' : '']">
78
-                  <text v-for="col in msg.columns" :key="col" class="td">{{ row[col] ?? '-' }}</text>
78
+                  <text v-for="col in msg.columns" :key="col" class="td">{{ row[col] != null ? row[col] : '-' }}</text>
79
                 </view>
79
                 </view>
80
               </scroll-view>
80
               </scroll-view>
81
             </view>
81
             </view>
@@ -302,7 +302,7 @@ export default {
302
         })
302
         })
303
         // 记录历史
303
         // 记录历史
304
         this.history.push({
304
         this.history.push({
305
-          question: this.messages[aiIdx - 1]?.text || '',
305
+          question: (this.messages[aiIdx - 1] && this.messages[aiIdx - 1].text) || '',
306
           sql: data.sql || '',
306
           sql: data.sql || '',
307
         })
307
         })
308
         this.scrollToBottom()
308
         this.scrollToBottom()