File tree 1 file changed +15
-3
lines changed
1 file changed +15
-3
lines changed Original file line number Diff line number Diff line change 28
28
-->
29
29
30
30
<template>
31
- <li class="action">
31
+ <li class="action" :class="{ 'action--disabled': disabled }" >
32
32
<span class="action-input">
33
33
<slot name="icon">
34
- <span :class="icon" class="action-input__icon" />
34
+ <span
35
+ :class="[isIconUrl ? 'action-input__icon--url' : icon]"
36
+ :style="{
37
+ backgroundImage: isIconUrl ? `url(${icon})` : null,
38
+ }"
39
+ class="action-input__icon"
40
+ />
35
41
</slot>
36
42
<form
37
43
ref="form"
@@ -92,6 +98,13 @@ const ActionGlobalMixin = {
92
98
},
93
99
94
100
computed: {
101
+ isIconUrl() {
102
+ try {
103
+ return new URL(this.icon)
104
+ } catch (error) {
105
+ return false
106
+ }
107
+ },
95
108
isLongText() {
96
109
return this.text && this.text.trim().length > 20
97
110
},
@@ -426,7 +439,6 @@ textarea {
426
439
427
440
// long text area
428
441
p {
429
-
430
442
// in case there are no spaces like long email addresses
431
443
overflow: hidden;
432
444
max-width: 220px;
You can’t perform that action at this time.
0 commit comments