♻️ (music) change lib to handle youtube video
This commit is contained in:
@@ -22,13 +22,28 @@
|
||||
<button v-show="timeState === 'stopped'" @click="start">commencer</button>
|
||||
<button v-show="timeState === 'started'" @click="clear">arrêter</button>
|
||||
</div>
|
||||
<ChilledMusic :play="timeState === 'started'" @pause="clear" />
|
||||
<div>
|
||||
<input
|
||||
type="checkbox"
|
||||
name="use-music"
|
||||
id="use-music"
|
||||
v-model="hasMusic"
|
||||
/>
|
||||
<label for="use-music">Musique de fond</label>
|
||||
<ChilledMusic
|
||||
v-if="hasMusic"
|
||||
:play="timeState === 'started'"
|
||||
@play="start"
|
||||
@pause="clear"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { defineComponent, onUnmounted } from '@vue/composition-api'
|
||||
import { useTimer } from '@/hooks/useTimer'
|
||||
import { useMusic } from '@/hooks/useMusic'
|
||||
import DevSession from '@/components/DevSession.vue'
|
||||
import ChilledMusic from '@/components/ChilledMusic.vue'
|
||||
import IntervalInput from '@/components/IntervalInput.vue'
|
||||
@@ -41,6 +56,7 @@ export default defineComponent({
|
||||
IntervalInput
|
||||
},
|
||||
setup() {
|
||||
const { hasMusic } = useMusic()
|
||||
const {
|
||||
interval,
|
||||
start,
|
||||
@@ -54,6 +70,7 @@ export default defineComponent({
|
||||
onUnmounted(clear)
|
||||
|
||||
return {
|
||||
hasMusic,
|
||||
interval,
|
||||
start,
|
||||
clear,
|
||||
|
||||
Reference in New Issue
Block a user