问题描述
我正在使用 vue-howler 并且出于某种原因,那里的数据是使用 mixin 传递的,我没有看到从 vue 文件脚本访问此类 mixin 的方法(更不用说我找到了一种方法改变里面的数据)
我想在 vuetify 滑块中显示播放音乐文件的进度,但由于包含在 mixin 中,我收到错误“计算属性已分配给但没有设置器。”
//MusicPlayerComponent.vue
<template>
<v-card flat width="500px" height="200px">
<v-flex class="info d-flex justify-center">
<v-btn icon large @click="togglePlayback">
<v-icon>
{{ playing ? 'mdi-pause' : 'mdi-play' }}
</v-icon>
</v-btn>
<v-slider v-model="progress" min="0" max="100">
</v-slider>
</v-card>
</template>
我不需要显示我的 vue 文件的脚本部分,因为那里实际上什么都没有,上面代码中的“progress、playing、togglePlayback”属性和函数都来自那个“mixin”
//MusicPlayerComponent.vue
<script lang="ts">
import { Component,Vue,Watch} from "vue-property-decorator"
// @ts-ignore
import VueHowler from 'vue-howler'
@Component({
mixins: [VueHowler]
})
export default class AudioPlayerComponent extends Vue {
}
</script>