Open samuil4 opened 5 years ago
You can refer to this file:
If you don't use vue-class-component
you can use as
to cast:
<template>
<aplayer
ref="aplayer"
:audio="audio"
:mini="playerConfig.mini"
:loop="playerConfig.loop"
:autoplay="playerConfig.autoplay"
:theme="playerConfig.theme"
:storageName="playerConfig.storageName"
@canplay="playSong"
@ended="playNextSong"
></aplayer>
</template>
<script lang="ts">
import { APlayer } from '@moefe/vue-aplayer';
export default {
playSong() {
const { currentSettings } = this.$refs.aplayer as APlayer;
}
};
</script>
Hi,
I'm trying to use
this.$refs.aplayer.currentSettings
but as all elements in thisthis.$refs
are html elements typescript gives me an errorProperty 'currentSettings' does not exist on type 'HTMLDivElement'.