Browse Source

使用全局notice

caner 1 year ago
parent
commit
4debc8ec4b
1 changed files with 1 additions and 3 deletions
  1. 1 3
      src/pages/room/component/mic.vue

+ 1 - 3
src/pages/room/component/mic.vue

@@ -9,7 +9,6 @@
 </template>
 
 <script setup lang='ts'>
-import { useNotification } from 'naive-ui'
 import {
   computed, onMounted, onUnmounted, ref
 } from 'vue'
@@ -17,7 +16,6 @@ import useStore from '@/store'
 
 const props = withDefaults(defineProps<{ value?: number }>(), { value: 5000 })
 const emit = defineEmits<{(evt: 'callBack', value: Blob): void }>()
-const notice = useNotification()
 const store = useStore()
 const rtcConnected = computed(() => store.rtcConnected)
 const show = ref(false)
@@ -42,7 +40,7 @@ async function initMic() {
   } catch (error: any) {
     console.log('录音错误', error)
     const type = error.toString().includes('getUserMedia')
-    notice.warning({ title: type ? '不支持webrtc音频' : '未获取到音频设备', duration: 2000 })
+    window.$notification.warning({ title: type ? '不支持webrtc音频' : '未获取到音频设备', duration: 2000 })
   }
 }