@ecolovo/uniapp-components 2.0.1 → 2.0.2
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/components/button/button.vue +33 -7
- package/package.json +1 -1
|
@@ -20,9 +20,18 @@
|
|
|
20
20
|
},
|
|
21
21
|
buttonSize,
|
|
22
22
|
]"
|
|
23
|
+
:disabled="isNotClickable"
|
|
23
24
|
:hover-class="disabled ? 'none' : $style['Button--active']"
|
|
24
25
|
:style="inlineCssVar"
|
|
25
26
|
@click="onClick"
|
|
27
|
+
@getphonenumber="$emit('getphonenumber', $event)"
|
|
28
|
+
@getuserinfo="$emit('getuserinfo', $event)"
|
|
29
|
+
@error="$emit('error', $event)"
|
|
30
|
+
@opensetting="$emit('opensetting', $event)"
|
|
31
|
+
@launchapp="$emit('launchapp', $event)"
|
|
32
|
+
@contact="$emit('contact', $event)"
|
|
33
|
+
@chooseavatar="$emit('chooseavatar', $event)"
|
|
34
|
+
@agreeprivacyauthorization="$emit('agreeprivacyauthorization', $event)"
|
|
26
35
|
>
|
|
27
36
|
<!-- 线性按钮边框:仅在线性按钮且不是禁用态时显示 -->
|
|
28
37
|
<view v-if="!disabled && !text && plain" :class="$style['Button--plain-border']"></view>
|
|
@@ -116,6 +125,14 @@ const props = withDefaults(defineProps<_Props>(), {
|
|
|
116
125
|
|
|
117
126
|
const emit = defineEmits<{
|
|
118
127
|
(event: 'click', payload?: Omit<PromiseWithResolvers<unknown>, 'promise'>): void;
|
|
128
|
+
(event: 'getphonenumber', payload?: unknown): void;
|
|
129
|
+
(event: 'getuserinfo', payload?: unknown): void;
|
|
130
|
+
(event: 'error', payload?: unknown): void;
|
|
131
|
+
(event: 'opensetting', payload?: unknown): void;
|
|
132
|
+
(event: 'launchapp', payload?: unknown): void;
|
|
133
|
+
(event: 'contact', payload?: unknown): void;
|
|
134
|
+
(event: 'chooseavatar', payload?: unknown): void;
|
|
135
|
+
(event: 'agreeprivacyauthorization', payload?: unknown): void;
|
|
119
136
|
}>();
|
|
120
137
|
|
|
121
138
|
/** 按钮是否冷却中 */
|
|
@@ -228,6 +245,22 @@ $button-sizes: (
|
|
|
228
245
|
.Button {
|
|
229
246
|
@extend %external-vars;
|
|
230
247
|
@extend %button-themes;
|
|
248
|
+
--button-color: #{UTILS__LOCAL_VAR(text-color)};
|
|
249
|
+
--button-background: #{UTILS__LOCAL_VAR(theme)};
|
|
250
|
+
color: var(--button-color);
|
|
251
|
+
background: var(--button-background);
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
.Button[disabled]:not([type]),
|
|
255
|
+
.Button[disabled][type='default'] {
|
|
256
|
+
color: var(--button-color);
|
|
257
|
+
background: var(--button-background);
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
.Button--plain,
|
|
261
|
+
.Button-text {
|
|
262
|
+
--button-color: var(var(#{__DO_NOT_USE__local-var-name(text-color)}), #{UTILS__LOCAL_VAR(theme)});
|
|
263
|
+
--button-background: transparent;
|
|
231
264
|
}
|
|
232
265
|
|
|
233
266
|
.Button--block {
|
|
@@ -241,8 +274,6 @@ $button-sizes: (
|
|
|
241
274
|
text-decoration: none;
|
|
242
275
|
text-align: center;
|
|
243
276
|
overflow: hidden;
|
|
244
|
-
color: UTILS__LOCAL_VAR(text-color);
|
|
245
|
-
background: UTILS__LOCAL_VAR(theme);
|
|
246
277
|
border: none;
|
|
247
278
|
|
|
248
279
|
@include button-size('block', 'normal');
|
|
@@ -309,9 +340,6 @@ $button-sizes: (
|
|
|
309
340
|
}
|
|
310
341
|
|
|
311
342
|
.Button--plain {
|
|
312
|
-
color: UTILS__LOCAL_VAR(theme);
|
|
313
|
-
background: transparent;
|
|
314
|
-
|
|
315
343
|
.Button--plain-border {
|
|
316
344
|
position: absolute;
|
|
317
345
|
top: 0;
|
|
@@ -329,9 +357,7 @@ $button-sizes: (
|
|
|
329
357
|
@extend %button-reset;
|
|
330
358
|
display: inline-block;
|
|
331
359
|
padding: 0;
|
|
332
|
-
color: UTILS__LOCAL_VAR(theme);
|
|
333
360
|
line-height: inherit;
|
|
334
|
-
background: transparent;
|
|
335
361
|
font-weight: inherit;
|
|
336
362
|
will-change: color;
|
|
337
363
|
|