|
10 | 10 | <NcButton v-for="option in options"
|
11 | 11 | :key="option.value"
|
12 | 12 | class="repeat-option-set-section-grid-item"
|
13 |
| - :class="option.selected ? 'primary' : 'secondary'" |
| 13 | + :type="option.selected ? 'primary' : 'secondary'" |
14 | 14 | @click="toggleByMonth(option.value)">
|
15 | 15 | {{ option.label }}
|
16 | 16 | </NcButton>
|
@@ -76,58 +76,19 @@ export default {
|
76 | 76 | computed: {
|
77 | 77 | options() {
|
78 | 78 | const monthNamesShort = getMonthNamesShort()
|
| 79 | + const options = [] |
79 | 80 |
|
80 | 81 | console.debug(this.byMonth)
|
| 82 | + |
| 83 | + monthNamesShort.forEach((monthName, index) => { |
| 84 | + options.push({ |
| 85 | + label: monthName, |
| 86 | + value: index + 1, |
| 87 | + selected: this.byMonth.includes(index + 1), |
| 88 | + }) |
| 89 | + }) |
81 | 90 |
|
82 |
| - return [{ |
83 |
| - label: monthNamesShort[0], |
84 |
| - value: 1, |
85 |
| - selected: this.byMonth.includes(1), |
86 |
| - }, { |
87 |
| - label: monthNamesShort[1], |
88 |
| - value: 2, |
89 |
| - selected: this.byMonth.includes(2), |
90 |
| - }, { |
91 |
| - label: monthNamesShort[2], |
92 |
| - value: 3, |
93 |
| - selected: this.byMonth.includes(3), |
94 |
| - }, { |
95 |
| - label: monthNamesShort[3], |
96 |
| - value: 4, |
97 |
| - selected: this.byMonth.includes(4), |
98 |
| - }, { |
99 |
| - label: monthNamesShort[4], |
100 |
| - value: 5, |
101 |
| - selected: this.byMonth.includes(5), |
102 |
| - }, { |
103 |
| - label: monthNamesShort[5], |
104 |
| - value: 6, |
105 |
| - selected: this.byMonth.includes(6), |
106 |
| - }, { |
107 |
| - label: monthNamesShort[6], |
108 |
| - value: 7, |
109 |
| - selected: this.byMonth.includes(7), |
110 |
| - }, { |
111 |
| - label: monthNamesShort[7], |
112 |
| - value: 8, |
113 |
| - selected: this.byMonth.includes(8), |
114 |
| - }, { |
115 |
| - label: monthNamesShort[8], |
116 |
| - value: 9, |
117 |
| - selected: this.byMonth.includes(9), |
118 |
| - }, { |
119 |
| - label: monthNamesShort[9], |
120 |
| - value: 10, |
121 |
| - selected: this.byMonth.includes(10), |
122 |
| - }, { |
123 |
| - label: monthNamesShort[10], |
124 |
| - value: 11, |
125 |
| - selected: this.byMonth.includes(11), |
126 |
| - }, { |
127 |
| - label: monthNamesShort[11], |
128 |
| - value: 12, |
129 |
| - selected: this.byMonth.includes(12), |
130 |
| - }] |
| 91 | + return options |
131 | 92 | },
|
132 | 93 | /**
|
133 | 94 | *
|
|
0 commit comments