classcard-ui 0.2.179 → 0.2.183
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<a
|
|
3
3
|
:href="href"
|
|
4
|
-
:class="classes"
|
|
5
|
-
class="flex cursor-pointer text-sm
|
|
4
|
+
:class="`${classes} ${textColor}`"
|
|
5
|
+
class="flex cursor-pointer text-sm hover:underline"
|
|
6
6
|
@click.prevent="action"
|
|
7
|
-
><c-icon
|
|
7
|
+
><c-icon
|
|
8
|
+
v-if="icon"
|
|
9
|
+
:type="icon.type"
|
|
10
|
+
:class="icon.class"
|
|
11
|
+
:name="icon.name"
|
|
12
|
+
></c-icon>
|
|
8
13
|
{{ label }}
|
|
9
14
|
</a>
|
|
10
15
|
</template>
|
|
@@ -31,6 +36,19 @@ export default {
|
|
|
31
36
|
action: {
|
|
32
37
|
type: Function,
|
|
33
38
|
},
|
|
39
|
+
color: {
|
|
40
|
+
type: String,
|
|
41
|
+
default: "blue",
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
computed: {
|
|
45
|
+
textColor() {
|
|
46
|
+
if (this.color === "red") {
|
|
47
|
+
return "text-red-800";
|
|
48
|
+
} else {
|
|
49
|
+
return "text-indigo-800";
|
|
50
|
+
}
|
|
51
|
+
},
|
|
34
52
|
},
|
|
35
53
|
};
|
|
36
54
|
</script>
|
|
@@ -181,7 +181,7 @@ export default {
|
|
|
181
181
|
data() {
|
|
182
182
|
return {
|
|
183
183
|
toggleDropdown: false,
|
|
184
|
-
selectedValue: this.value
|
|
184
|
+
selectedValue: this.value !== null && this.value.option ? this.value.option : this.value,
|
|
185
185
|
showSelectedValue: false,
|
|
186
186
|
showFocus: false,
|
|
187
187
|
};
|
|
@@ -214,7 +214,7 @@ export default {
|
|
|
214
214
|
},
|
|
215
215
|
watch: {
|
|
216
216
|
value() {
|
|
217
|
-
this.selectedValue = this.value.option ? this.value.option : this.value;
|
|
217
|
+
this.selectedValue = this.value !== null && this.value.option ? this.value.option : this.value;
|
|
218
218
|
},
|
|
219
219
|
},
|
|
220
220
|
};
|
|
@@ -8,6 +8,7 @@ export default {
|
|
|
8
8
|
label: String,
|
|
9
9
|
href: String,
|
|
10
10
|
icon: { control: { type: "object" } },
|
|
11
|
+
color: { control: { type: "select", options: ["blue", "red"] } },
|
|
11
12
|
},
|
|
12
13
|
};
|
|
13
14
|
|
|
@@ -25,4 +26,5 @@ Default.args = {
|
|
|
25
26
|
name: "download",
|
|
26
27
|
type: "outline",
|
|
27
28
|
},
|
|
29
|
+
color: "blue",
|
|
28
30
|
};
|