import { defineComponent } from 'vue'
import MusicList from '@/views/music/list'

export default defineComponent({
  name: 'music',
  props: {
    height: {
      type: Number,
      default: 0
    }
  },
  data() {
    const query = this.$route.query
    return {
      teacherId: query.teacherId as string,
      list: [],
      dataShow: false, // 判断是否有数据
      loading: false,
      finished: false,
      params: {
        page: 1,
        rows: 20
      }
    }
  },
  methods: {
    onItemClick(item: any) {
      this.$router.push({
        path: '/music-detail',
        query: {
          id: item.id
        }
      })
    }
  },
  render() {
    return (
      <MusicList
        hideSearch
        onlySearch
        height={this.height}
        myself
        onItemClick={this.onItemClick}
        teacherId={this.teacherId}
      />
    )
  }
})
