如何在 Vue.js 中将每个 unik 医生与生成的时间数组相关联?

问题描述 投票:0回答:1

试动态路由关联医生ID卡死!!! 尝试与下拉 v-select 相关联,但也卡住了! 现在只需要能够显示每个医生的时间表,请帮助! 使用 vue2 和 vuetify

<script>
import Navbar from '../components/Navbar.vue'
import doctorTimeService from '../services/DoctorTimeService.js'

export default {
    name: 'calendar',
    components: {
      Navbar
    },
    data() {
        return {
            mode: 'stack',
            modes: ['stack', 'column'],
            weekday: [0, 1, 2, 3, 4, 5, 6],
            timeSlots: [],
            timeSlotByDoctor: [],
            today: new Date(),  
        }
    },
    methods: {
        getTimeSlots() {
          doctorTimeService.getAllTimeSlots().then(response => {
          this.$store.commit("SET_TIMESLOTS", response.data);
        });
      }
    },
    computed: {
      getTimeForDoc() {
      return null;
      }
      // loop over timeslots object to acces start time and end time
        // push first time into timeSlotByDoctor
        // each loop, increment minutes by 30
        // store start time hour and minute in object, and increment those values?
        // concat values back into time format, push into timeSlotByDoctor each iteration
    },
    created() {
        this.getTimeSlots();
        this.doctors = this.$store.state.doctors;
        this.timeSlots = this.$store.state.timeSlots;
        console.log('test', this.timeSlots);
        console.log(this.doctorNames);
    }
}
    
</script>
javascript vue.js vuejs2 frontend vuex
1个回答
0
投票

你试过把这一切都放在后端吗?这在 vue 中是不可能的!

编辑:Java 很棒!我推荐使用它!

© www.soinside.com 2019 - 2024. All rights reserved.