我的账户
猩码学苑

专注C++开发菁英教育

亲爱的游客,欢迎!

已有账号,请

如尚未注册?

李扬敏-20230106-vue

[复制链接]
王源的李可爱 发表于 2023-1-7 09:42:23 | 显示全部楼层 |阅读模式 打印 上一主题 下一主题
export default {
components: { PlayerHeader, PlayerMiddle, PlayerBottom },
name: "Player",
data() {
return {
totalTime: 0,
curTime: 0,
};
},
created() {},
mounted() {
this.$refs.audio.oncanplay = () => {
//   console.log("11111===", this.$refs.audio.duration);
this.totalTime = this.$refs.audio.duration;
};
},
methods: {
timeupdate(e) {
//   console.log("time===", e.target.currentTime);
this.curTime = e.target.currentTime;
},
},
computed: {
// mapGetters辅助函数
...mapGetters([
"isFullScreen",
"currentSong",
"isPlaying",
"currentTime",
"currentLyric",
]),
},
watch: {
currentSong(newV) {},
isPlaying(newV) {
if (newV) {
// this.$refs.audio.oncanplay = () => {
this.$refs.audio.play();
// };
} else {
this.$refs.audio.pause();
}
},
currentTime(newV) {
this.$refs.audio.currentTime = newV;
},
},
};

回复

使用道具 举报

关注0

粉丝0

帖子58

发布主题
大家都在学
课堂讨论
一周热帖排行最近7x24小时热帖
关注我们
专注C++菁英教育

客服电话:18009298968

客服时间:9:00-21:00

猩码学苑 - 专注C++开发菁英教育!( 陕ICP备2025058934号-1 )

版权所有 © 陕西菁英数字科技有限公司 2023-2026