Commit f056572f authored by 水玉婷's avatar 水玉婷
Browse files

feat:优化体验

parent 250352be
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { ref, computed, onUnmounted } from 'vue' import { ref, computed, onUnmounted, nextTick } from 'vue'
import { AudioOutlined } from '@ant-design/icons-vue' import { AudioOutlined } from '@ant-design/icons-vue'
import { post } from '@/utils/axios' // 导入项目中的axios import { post } from '@/utils/axios' // 导入项目中的axios
...@@ -261,7 +261,7 @@ const stopRecordingTimer = () => { ...@@ -261,7 +261,7 @@ const stopRecordingTimer = () => {
} }
// 停止录音 // 停止录音
const stopRecording = () => { const stopRecording = async () => {
if (!isRecording.value) return if (!isRecording.value) return
if (mediaRecorder.value && mediaRecorder.value.state === 'recording') { if (mediaRecorder.value && mediaRecorder.value.state === 'recording') {
...@@ -277,6 +277,10 @@ const stopRecording = () => { ...@@ -277,6 +277,10 @@ const stopRecording = () => {
audioStream.value = null; audioStream.value = null;
} }
// 等待Vue完成DOM更新后再退出全屏
await nextTick();
exitFullScreen();
// 通知父组件停止录音 // 通知父组件停止录音
emit('recordingStop'); emit('recordingStop');
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment