Skip to content

Commit d00f7bb

Browse files
committed
(slots) add audio icons
1 parent f69531b commit d00f7bb

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/ChatWindow/Message/AudioPlayer.vue

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,13 @@
22
<div>
33
<div class="vac-audio-player">
44
<div class="vac-svg-button" @click="playback">
5-
<svg-icon :name="isPlaying ? 'audio-pause' : 'audio-play'" />
5+
<slot v-if="isPlaying" name="audio-pause-icon">
6+
<svg-icon name="audio-pause" />
7+
</slot>
8+
<slot v-else name="audio-play-icon">
9+
<svg-icon name="audio-play" />
10+
</slot>
611
</div>
7-
812
<audio-control
913
ref-id="progress"
1014
:percentage="progress"
@@ -54,7 +58,7 @@ export default {
5458
return null
5559
},
5660
time() {
57-
return this.isPlaying ? this.playedTime : this.duration
61+
return this.progress > 1 ? this.playedTime : this.duration
5862
}
5963
},
6064

0 commit comments

Comments
 (0)