Skip to content

Commit 3d9aaf1

Browse files
committed
docs: remove solo feature
1 parent 4c7e92c commit 3d9aaf1

File tree

3 files changed

+3
-32
lines changed

3 files changed

+3
-32
lines changed

example/src/App.vue

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -53,16 +53,11 @@ const items = reactive<Props[]>([
5353
},
5454
])
5555
56-
const solo = useStorage('solo', true)
5756
const skeleton = useStorage('skeleton', true)
5857
const interact = useStorage('interact', true)
5958
const lazy = useStorage('lazy', true)
6059
const fade = useStorage('fade', true)
6160
62-
const toggleMono = () => {
63-
solo.value = !solo.value
64-
}
65-
6661
const toggleInteract = () => {
6762
interact.value = !interact.value
6863
}
@@ -78,15 +73,6 @@ const toggleLazy = () => {
7873
const toggleFade = () => {
7974
fade.value = !fade.value
8075
}
81-
82-
const childs = reactive<(typeof Demo)[]>([])
83-
84-
const playHandler = (id: string) => {
85-
if (!solo.value) return
86-
childs.forEach((child) => {
87-
if (child.id !== id && child.playing) child.pause()
88-
})
89-
}
9076
</script>
9177

9278
<template>
@@ -106,11 +92,6 @@ const playHandler = (id: string) => {
10692
</button>
10793

10894
<div class="mb-8 flex">
109-
<button @click="toggleMono()">
110-
<span :class="{ 'bg-green-500': solo }" />
111-
<div>solo</div>
112-
</button>
113-
11495
<button @click="toggleInteract()">
11596
<span :class="{ 'bg-green-500': interact }" />
11697
<div>interact</div>
@@ -134,15 +115,12 @@ const playHandler = (id: string) => {
134115

135116
<Demo
136117
v-for="item in items"
137-
:id="item.id"
138-
ref="childs"
139118
:key="item.id"
140119
:url="item.url"
141120
:interact="interact"
142121
:skeleton="skeleton"
143122
:lazy="lazy"
144123
:fade="fade"
145-
@play="playHandler"
146124
/>
147125
</section>
148126
</template>

example/src/components/Demo.vue

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import ReplayIcon from './icons/Replay.vue'
1818
1919
const darkMode = useDark()
2020
21-
const props = defineProps(['id', 'url', 'interact', 'skeleton', 'lazy', 'fade'])
21+
const props = defineProps(['url', 'interact', 'skeleton', 'lazy', 'fade'])
2222
2323
const waveOptions = reactive<IllestWaveformProps>({
2424
url: props.url,
@@ -78,7 +78,6 @@ const clickHandler = (el: Ref<HTMLElement>) => {
7878
}
7979
8080
const play = () => {
81-
emits('play', props.id)
8281
waveformRef.value!.play()
8382
}
8483
@@ -101,14 +100,6 @@ const getDuration = () => {
101100
const duration = waveformRef.value!.getDuration()
102101
durationTime.value = duration
103102
}
104-
105-
const emits = defineEmits(['play'])
106-
107-
defineExpose({
108-
pause,
109-
playing,
110-
id: props.id,
111-
})
112103
</script>
113104

114105
<template>

src/components/IllestWaveform.vue

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@ onUnmounted(() => {
6666
__illestWaveformRef__.value as HTMLElement,
6767
lazyLoadHandler
6868
)
69+
70+
audioController && audioController.pause()
6971
})
7072
7173
function lazyLoadHandler() {

0 commit comments

Comments
 (0)