From 8d571063e987b3b89e9b1028f7dfb7c5f2fdceb2 Mon Sep 17 00:00:00 2001 From: snsd0805 Date: Thu, 17 Sep 2020 15:30:43 +0800 Subject: [PATCH] feat: check if user have courses on the weekend(#1) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 檢查是否有週末的課,若有則設定flag - 未更動前端表格 --- js/components/table.vue | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/js/components/table.vue b/js/components/table.vue index 8188cfa..56d71b1 100644 --- a/js/components/table.vue +++ b/js/components/table.vue @@ -18,6 +18,7 @@ var courseTable = { data: function(){ return { 'courses': {}, + 'existWeekend': false } }, methods: { @@ -37,8 +38,17 @@ var courseTable = { watch: { 'select_c': function(){ this.courses = {} + var weekendLock = false + for(var c of this.select_c){ this.courses[c.time] = c.name + + if(c.time[0]==6 || c.time[0]==7){ + weekendLock = true + } + } + if(weekendLock){ + this.existWeekend = true } } },