FloorList.vue 904 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <template>
  2. <div class="floor-list">
  3. <div class="container">
  4. <floor-bar :floors="floors"></floor-bar>
  5. <floor v-for="(floor, index) in floors.data" :floor="floor" :key="index"></floor>
  6. </div>
  7. </div>
  8. </template>
  9. <script>
  10. import Floor from './Floor.vue'
  11. import FloorBar from './FloorBar.vue'
  12. export default {
  13. name: 'floor-list',
  14. components: {
  15. Floor,
  16. FloorBar
  17. },
  18. data () {
  19. return {
  20. floors: {}
  21. }
  22. },
  23. mounted () {
  24. this.$http.get('/api/floors/home')
  25. .then(response => {
  26. this.floors = response
  27. })
  28. }
  29. // computed: {
  30. // floors () {
  31. // return this.$store.state.floor.list
  32. // }
  33. // }
  34. }
  35. </script>
  36. <style lang="scss" scoped>
  37. @import '~assets/scss/variables';
  38. /*add*/
  39. .floor-list .container{
  40. padding: 0;
  41. }
  42. .floor-list {
  43. margin-bottom: $xlg-pad;
  44. }
  45. </style>