index.vue 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. <template>
  2. <LayoutContainer class="mt-4">
  3. <v-expansion-panels focusable multiple :value="[0]">
  4. <!-- Billing -->
  5. <UiExpansionPanel id="residenceArea" icon="fa-globe-europe">
  6. <v-container fluid class="container">
  7. <v-row>
  8. <v-col cols="12" sm="12">
  9. <UiCollection
  10. :query="query()"
  11. :model="model"
  12. loaderType="image"
  13. newLink="/parameters/billing/residence_area/new"
  14. >
  15. <template #list.item="{items}">
  16. <v-container fluid>
  17. <v-row dense>
  18. <v-col
  19. v-for="item in items"
  20. :key="item.id"
  21. cols="4"
  22. >
  23. <UiCard
  24. :id="item.id"
  25. :link="`/parameters/billing/residence_area/${item.id}`"
  26. :model="model"
  27. >
  28. <template #card.text>
  29. {{ item.label }}
  30. </template>
  31. </UiCard>
  32. </v-col>
  33. </v-row>
  34. </v-container>
  35. </template>
  36. </UiCollection>
  37. </v-col>
  38. </v-row>
  39. </v-container>
  40. </UiExpansionPanel>
  41. </v-expansion-panels>
  42. </LayoutContainer>
  43. </template>
  44. <script lang="ts">
  45. import {computed, ComputedRef, defineComponent} from '@nuxtjs/composition-api'
  46. import { repositoryHelper } from '~/services/store/repository'
  47. import {Query} from "@vuex-orm/core";
  48. import {ResidenceArea} from "~/models/Billing/ResidenceArea";
  49. export default defineComponent({
  50. name: 'residence-areas',
  51. setup () {
  52. const repository = repositoryHelper.getRepository(ResidenceArea)
  53. const query: ComputedRef<Query> = computed(() => repository.query())
  54. /** todo Computed properties needs to be returned as functions until nuxt3 : https://github.com/nuxt-community/composition-api/issues/207 **/
  55. return {
  56. query: () => query,
  57. model: ResidenceArea
  58. }
  59. }
  60. })
  61. </script>