<ion-header [translucent]="true">
  <ion-toolbar>
    <ion-buttons slot="start">
      <ion-back-button defaultHref="/tabs/tab1"></ion-back-button>
    </ion-buttons>
    <ion-title>
      问答
    </ion-title>
  </ion-toolbar>
</ion-header>

<ion-content>
  <!-- 文本域：生成提示词 -->
  <h1>输入问题</h1>
  <ion-textarea [value]="userPrompt" (ionInput)="promptInput($event)" placeholder="文本提示词" autoGrow="true"></ion-textarea>
  
  <!-- 按钮：执行消息生成函数 -->
  <ion-button (click)="sendMessage()" expand="block">提交问题</ion-button>
  
  <!-- 展示：返回消息内容 -->
  <div *ngIf="!isComplete">{{responseMsg}}</div>
  
  <!-- 消息传输完成后，实时预览Markdown格式 -->
  <fm-markdown-preview *ngIf="isComplete" class="content-style" [content]="responseMsg"></fm-markdown-preview>
</ion-content>