• This project
    • Loading...
  • Sign in

Hooke / mlaj

Itomix
Go to a project
Toggle navigation Toggle navigation pinning
  • Projects
  • Groups
  • Snippets
  • Help
  • Project
  • Activity
  • Repository
  • Pipelines
  • Graphs
  • Issues 0
  • Merge Requests 0
  • Wiki
  • Snippets
  • Network
  • Create a new issue
  • Builds
  • Commits
  • Issue Boards
  • Files
  • Commits
  • Network
  • Compare
  • Branches
  • Tags
Switch branch/tag
  • mlaj
  • src
  • composables
  • useHomeVideoPlayer.js
  • hookehuyr's avatar
    feat(home): 重构首页组件并添加新功能模块 · b9eb5c0e ...
    b9eb5c0e
    将首页功能拆分为独立组件,包括精选课程轮播、推荐课程、热门课程和最新活动模块
    新增 useHomeVideoPlayer 组合式函数管理视频播放状态
    优化代码结构和可维护性,减少主组件复杂度
    hookehuyr authored 2025-12-27 23:48:15 +0800
useHomeVideoPlayer.js 351 Bytes
Raw Blame History Permalink
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
import { ref } from 'vue'

export const useHomeVideoPlayer = () => {
    const activeVideoIndex = ref(null)

    const playVideo = (index) => {
        activeVideoIndex.value = index
    }

    const closeVideo = () => {
        activeVideoIndex.value = null
    }

    return {
        activeVideoIndex,
        playVideo,
        closeVideo
    }
}