|
1 | 1 | <template>
|
2 | 2 | <div
|
3 | 3 | class="dropdown"
|
4 |
| - @click.stop="toggleDropdownOptions" |
5 |
| - :class="{ expanded: isExpanded }"* |
| 4 | + @click.stop="checkDropdownHandler" |
| 5 | + :class="{ expanded: isExpanded, disabled: config.disabled }" |
6 | 6 | :style="computedStyles"
|
7 | 7 | >
|
8 | 8 | <div class="dropdown-label-container">
|
|
47 | 47 | backgroundColor: "#cde4f5",
|
48 | 48 | backgroundExpandedColor: "#fff",
|
49 | 49 | hoverBackgroundColor: "#0084d4",
|
| 50 | + disabledBackgroundColor: "#ccc", |
50 | 51 | isExpanded: false,
|
51 | 52 | placeholder: "Placeholder",
|
52 | 53 | textColor: "black",
|
|
65 | 66 | {"--option-height": this.optionHeight + "px"},
|
66 | 67 | {"--main-el-border-radius": this.borderRadius},
|
67 | 68 | {"--dropdown-width": this.width + "px"},
|
68 |
| - {"--dropdown-background-color": this.backgroundColor}, |
| 69 | + {"--dropdown-background-color": this.config.disabled ? this.disabledBackgroundColor : this.backgroundColor}, |
69 | 70 | {"--dropdown-expanded-color": this.backgroundExpandedColor},
|
70 | 71 | {"--dropdown-border": this.border},
|
71 | 72 | {"--dropdown-hover-background-color": this.hoverBackgroundColor},
|
|
142 | 143 | if (this.isExpanded) {
|
143 | 144 | this.isExpanded = false
|
144 | 145 | }
|
145 |
| - } |
| 146 | + }, |
| 147 | + checkDropdownHandler() { |
| 148 | + if (!this.config.disabled) { |
| 149 | + this.toggleDropdownOptions() |
| 150 | + } |
| 151 | + }, |
146 | 152 | },
|
147 | 153 | created() {
|
148 | 154 | document.addEventListener('click', this.documentClicked);
|
|
0 commit comments