[baozhangchao] 3 years ago
parent
commit
3b2355ba90
1 changed files with 3 additions and 4 deletions
  1. 3
    4
      src/components/MusicOnce.vue

+ 3
- 4
src/components/MusicOnce.vue View File

3
 </template>
3
 </template>
4
 
4
 
5
 <script setup>
5
 <script setup>
6
-import { ref } from 'vue';
6
+import { ref } from 'vue'
7
 
7
 
8
 const props = defineProps({
8
 const props = defineProps({
9
-  src: String,
9
+  src: String
10
 })
10
 })
11
 
11
 
12
 const audioRef = ref()
12
 const audioRef = ref()
16
     audioRef.value.currentTime = 0
16
     audioRef.value.currentTime = 0
17
     audioRef.value.play()
17
     audioRef.value.play()
18
   },
18
   },
19
-  pause: () => audioRef.value.pause(),
19
+  pause: () => audioRef.value.pause()
20
 })
20
 })
21
-
22
 </script>
21
 </script>
23
 
22
 
24
 <style lang="less" scoped>
23
 <style lang="less" scoped>