Bilibili-Evolved/registry/lib/components/video/download/inputs/episode-item.ts
2022-10-12 23:27:58 +08:00

27 lines
638 B
TypeScript

import { DownloadVideoInputItem } from '../types'
import EpisodesPicker from './EpisodesPicker.vue'
export interface EpisodeItem {
key: string
title: string
isChecked: boolean
inputItem: DownloadVideoInputItem
durationText?: string
}
export const createEpisodesPicker = (
fetchEpisodeItems: (instance: any) => Promise<EpisodeItem[]>,
) =>
Vue.extend({
computed: {
checkedInputItems() {
return this.$refs.picker.checkedInputItems
},
},
render(createElement) {
return createElement(EpisodesPicker, {
props: { api: fetchEpisodeItems },
ref: 'picker',
})
},
})