Sfoglia il codice sorgente

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

simonlll 1 settimana fa
parent
commit
263410a424
1 ha cambiato i file con 2 aggiunte e 2 eliminazioni
  1. 2 2
      src/pages/ai-chat/index.vue

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

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