<template>
    <v-layout row wrap>
        <slot name="hlavicka"></slot>
        <v-flex xs12>
            <v-container fluid grid-list-md>
                <v-layout row wrap>
                    <v-flex xs12 sm6 md4 lg4 v-for="(polozka, zIndex) in zoznam" :key="zIndex">
                        <polozka :ucebnica="polozka" @otvoritUcebnicu="otvoritUcebnicu"></polozka>
                    </v-flex>
                </v-layout>
            </v-container>
        </v-flex>
    </v-layout>
</template>

<script>
  import Polozka from './Polozka'

  export default {
    name: 'ZoznamUcebnychMaterialovKategorie',
    components: {
      Polozka
    },
    props: {
      zoznam: {
        type: Array,
        required: true
      },
      loading: {
        type: Boolean,
        default: false
      }
    },
    data() {
      return {}
    },
    computed: {},
    methods: {
      otvoritUcebnicu (data) {
        this.$router.push({
          name: 'Učebný materiál',
          params: {
            kategoria_id: data.kategoria_id,
            ucebnica_id: data.id,
          }
        })
      }
    },
    watch: {},
  }
</script>

<style scoped>

</style>