当前位置: 首页 > news >正文

vue音乐播放条

先看效果
在这里插入图片描述
再看代码

<template><div class="footer-player z-30 flex items-center p-2"><div v-if="isShow" class="h-12 w-60 overflow-hidden"><div :style="activeStyle" class="open-detail-control-wrap"><div class="flex h-full w-40 items-center"><div ref="triggerRef" class="relative" @click="handleArrowClick"><n-imageclass="size-12":src="currentSong?.al?.picUrl":preview-disabled="true":style="{filter:isHover ? 'blur(1px)' : 'none'}"/><transition v-show="isHover" name="fade"><div class="flex-items-justify-center absolute left-0 top-0 z-10  size-12 bg-black/60"><n-icon :component="KeyboardArrowUpOutlined" size="35" color="white" /></div></transition></div><div class="ml-4"><p class="flex items-center text-base"><n-ellipsis style="max-width: 150px">{{ currentSong?.name }}</n-ellipsis><heart-icon:id="mainStore.currentPlaySong.id" class="ml-2" :like="mainStore.currentPlaySong.like"@like-success="likeSuccess"/> </p><n-ellipsis><p>{{ formateSongsAuthor(currentSong?.ar || []) }}</p></n-ellipsis></div></div><div class="flex h-12 items-center"><n-iconsize="35" :component="KeyboardArrowDownOutlined" class="ml-4"@click="mainStore.setShowMusicDetail(false)"/><div class="ml-4"><div class="circleContainer" @click="handleLikeHeartClick"><heart-icon:id="mainStore.currentPlaySong.id"ref="heardLikeRef" :like="mainStore.currentPlaySong.like":size="25" :trigger-click="true" @like-success="likeSuccess"/> </div></div><div class="circleContainer ml-4" @click="subscribeModalRef?.show()"><n-icon :component="AddBoxOutlined" :size="20" /></div></div></div></div><div :style="{opacity:isShow ? '1' : '0.6'}" class="control flex flex-1 flex-col items-center"><div v-if="!isShow" class="footer-player absolute z-50 w-full" /><div style="width:300px" class="flex items-center justify-between"><n-iconclass="custom-icon" :size="22" :component="currentPlayModeIcon"@click="handlePlayModeClick"/><n-iconclass="prev custom-icon" :size="22" :component="SkipPreviousSharp"@click="handlePrevClick"/><divclass="flex size-8 items-center justify-center rounded-full  bg-neutral-200/60 hover:bg-neutral-200 dark:bg-slate-100/20 dark:hover:bg-slate-100/40" @click="togglePlayStatus"><n-icon :size="mainStore.playing ? 14 : 20" :component="mainStore.playing ? StopIcon :PlayArrowSharp" </div><n-iconclass="next custom-icon" :size="22" :component="SkipNextSharp"@click="handleNextClick"/></div><div class="mt-1 flex items-center"><span v-if="isShow" class="mr-2 text-xs opacity-50">{{ currentPlayTime }}</span><div class="flex flex-1 items-center" :style="{width:progressWidth+'px'}"><slider-barv-model="percentage":load-value="progressValue"@on-done="handleSliderDone"@change="handleSliderChange"/></div><span v-if="isShow" class="ml-2 text-xs opacity-50"><n-time format="mm:ss" :time="currentSong?.dt" /></span></div></div><div v-if="isShow" class="flex w-60 items-center justify-end"><n-popoverplacement="bottom"trigger="hover"><template #trigger><n-icon:component="volume === 0 ? VolumeOffRound : VolumeUpRound" :size="25" class="custom-icon mr-2"@click="handleVolumeClick"/></template><n-slider:value="volume" vertical style="height:100px"@update-value="handleVolumeChange"/></n-popover><n-icon:component="List" :size="25" class="custom-icon mr-2"@click="playListRef?.show()"/></div><audioref="audioRef":src="currentSong?.url"preload="auto" @timeupdate="handleTimeupdate" @ended="handleEnded"@playing="handlePlaying" @progress="updateBuffer" @loadeddata="handleLoadeddata"@error="handleError" @waiting="handleWaiting" /><play-list ref="playListRef" /><music-detail v-if="mainStore.currentPlaySong?.id" ref="musicDetailRef" /><subscribe-play-list-modalv-if="mainStore.currentPlaySong?.id" ref="subscribeModalRef" :tracks="mainStore.currentPlaySong?.id"/></div>
</template>
http://www.lryc.cn/news/374961.html

相关文章:

  • halcon实现浓淡补正,中间值补正-抽取暗
  • 太速科技-FMC213V3-基于FMC兼容1.8V IO的Full Camera Link 输入子卡
  • GPU短缺和模型效率的推动
  • linux在文件夹中查找文件内容
  • 算法:11. 盛最多水的容器
  • Hazelcast 分布式缓存 在Seatunnel中的使用
  • 分数限制下,选好专业还是选好学校?
  • 软件改为开机自启动
  • 集群down机的应急和恢复测试(非重做备机)
  • 【数据库系统概论复习】关系数据库与关系代数笔记
  • 赛氪网受邀参加上海闵行区翻译协会年会,共探科技翻译创新之路
  • 项目管理进阶之EVM(挣值管理)
  • PLSQL、Oracle以及客户端远程连接服务器笔记(仅供参考)
  • Win快速删除node_modules
  • 【机器学习】基于顺序到顺序Transformer机器翻译
  • TEA 加密的 Java 实现
  • 鸿蒙开发电话服务:【@ohos.telephony.data (蜂窝数据)】
  • Maven认识与学习
  • “深入探讨Redis主从复制:原理、配置与优化“
  • HTML初体验
  • 全局特征提取netvlad的理解
  • 【设计模式-12】代理模式的代码实现及使用场景
  • 网工内推 | 神州数码、弧聚科技网工,IE认证优先,最高18K
  • 【Linux】模拟实现一个简单的日志系统
  • MongoDB 多层级查询
  • grpc代理服务的实现(一)
  • FastAPI系列 4 -路由管理APIRouter
  • 数据驱动制造:EMQX ECP 指标监测功能增强生产透明度
  • 一行代码实现鼠标横向滚动
  • Flink集群架构