Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion doc/button.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,10 @@
```vue
<template>
<div class="md-demo-button">
<sp-button type="primary" :loading="true">加载中</sp-button>
<sp-button :loading="true">加载中</sp-button>
<sp-button :loading="true" type="primary">加载中</sp-button>
<sp-button :loading="true" plain>加载中</sp-button>
<sp-button :loading="true" type="text">加载中</sp-button>
</div>
</template>
```
Expand Down
22 changes: 17 additions & 5 deletions sparta/components/button/src/button.vue
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,11 @@ export default {
&:focus {
background-color: $button-plain-fill--focus;
}
&.is--loading {
background-color: transparent;
color: $button-text-color--disabled;
border-color: $button-plain-border--disabled;
}
}

&.is--disabled {
Expand Down Expand Up @@ -184,7 +189,6 @@ export default {
&.is--loading {
position: relative;
pointer-events: none;
color: rgba(#fff, 0.5);

&::before {
pointer-events: none;
Expand All @@ -198,10 +202,12 @@ export default {
}
}

&.is--plain.is--loading {
position: relative;
pointer-events: none;
color: rgba($color-primary, 0.5);
&--default {
&.is--loading {
color: $button-color--disabled;
background-color: $button-fill--disabled;
border-color: $button-fill--disabled;
}
}

&--primary {
Expand Down Expand Up @@ -230,6 +236,11 @@ export default {
background-color: $button-primary-fill--focus;
border-color: $button-primary-border--focus;
}
&.is--loading {
background-color: $button-primary-fill;
border-color: $button-primary-border;
color: rgba(#fff, 0.5);
}
}
&--medium {
@include button-size($button-medium-font-size, $button-medium-min-width, $button-medium-height);
Expand Down Expand Up @@ -271,6 +282,7 @@ export default {
}

&.is--disabled,
&.is--loading,
&.is--disabled:hover,
&.is--disabled:focus {
border-color: transparent;
Expand Down