mirror of
https://gitee.com/vant-contrib/vant-weapp.git
synced 2025-04-06 03:58:05 +08:00
fix(GoodsActionButton): fix style error (#2762)
This commit is contained in:
parent
9d6ef0e955
commit
4ed51fd859
@ -8,13 +8,13 @@
|
|||||||
justify-content: center;
|
justify-content: center;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
line-height: @button-line-height;
|
|
||||||
text-align: center;
|
text-align: center;
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
-webkit-appearance: none;
|
-webkit-appearance: none;
|
||||||
-webkit-text-size-adjust: 100%;
|
-webkit-text-size-adjust: 100%;
|
||||||
|
|
||||||
.theme(height, '@button-default-height');
|
.theme(height, '@button-default-height');
|
||||||
|
.theme(line-height, '@button-line-height');
|
||||||
.theme(font-size, '@button-default-font-size');
|
.theme(font-size, '@button-default-font-size');
|
||||||
.theme(transition, 'opacity @animation-duration-fast');
|
.theme(transition, 'opacity @animation-duration-fast');
|
||||||
.theme(border-radius, '@button-border-radius');
|
.theme(border-radius, '@button-border-radius');
|
||||||
@ -50,36 +50,36 @@
|
|||||||
|
|
||||||
&--default {
|
&--default {
|
||||||
.theme(color, '@button-default-color');
|
.theme(color, '@button-default-color');
|
||||||
.theme(background-color, '@button-default-background-color');
|
.theme(background, '@button-default-background-color');
|
||||||
.theme(border, '1px solid @button-default-border-color');
|
.theme(border, '@button-border-width solid @button-default-border-color');
|
||||||
}
|
}
|
||||||
|
|
||||||
&--primary {
|
&--primary {
|
||||||
.theme(color, '@button-primary-color');
|
.theme(color, '@button-primary-color');
|
||||||
.theme(background-color, '@button-primary-background-color');
|
.theme(background, '@button-primary-background-color');
|
||||||
.theme(border, '1px solid @button-primary-border-color');
|
.theme(border, '@button-border-width solid @button-primary-border-color');
|
||||||
}
|
}
|
||||||
|
|
||||||
&--info {
|
&--info {
|
||||||
.theme(color, '@button-info-color');
|
.theme(color, '@button-info-color');
|
||||||
.theme(background-color, '@button-info-background-color');
|
.theme(background, '@button-info-background-color');
|
||||||
.theme(border, '1px solid @button-info-border-color');
|
.theme(border, '@button-border-width solid @button-info-border-color');
|
||||||
}
|
}
|
||||||
|
|
||||||
&--danger {
|
&--danger {
|
||||||
.theme(color, '@button-danger-color');
|
.theme(color, '@button-danger-color');
|
||||||
.theme(background-color, '@button-danger-background-color');
|
.theme(background, '@button-danger-background-color');
|
||||||
.theme(border, '1px solid @button-danger-border-color');
|
.theme(border, '@button-border-width solid @button-danger-border-color');
|
||||||
}
|
}
|
||||||
|
|
||||||
&--warning {
|
&--warning {
|
||||||
.theme(color, '@button-warning-color');
|
.theme(color, '@button-warning-color');
|
||||||
.theme(background-color, '@button-warning-background-color');
|
.theme(background, '@button-warning-background-color');
|
||||||
.theme(border, '1px solid @button-warning-border-color');
|
.theme(border, '@button-border-width solid @button-warning-border-color');
|
||||||
}
|
}
|
||||||
|
|
||||||
&--plain {
|
&--plain {
|
||||||
.theme(background-color, '@button-plain-background-color');
|
.theme(background, '@button-plain-background-color');
|
||||||
|
|
||||||
&.van-button--primary {
|
&.van-button--primary {
|
||||||
.theme(color, '@button-primary-background-color');
|
.theme(color, '@button-primary-background-color');
|
||||||
|
@ -101,6 +101,7 @@
|
|||||||
@button-warning-background-color: @orange;
|
@button-warning-background-color: @orange;
|
||||||
@button-warning-border-color: @orange;
|
@button-warning-border-color: @orange;
|
||||||
@button-line-height: 20px;
|
@button-line-height: 20px;
|
||||||
|
@button-border-width: 1px;
|
||||||
@button-border-radius: @border-radius-sm;
|
@button-border-radius: @border-radius-sm;
|
||||||
@button-round-border-radius: @border-radius-max;
|
@button-round-border-radius: @border-radius-max;
|
||||||
@button-plain-background-color: @white;
|
@button-plain-background-color: @white;
|
||||||
|
@ -6,42 +6,40 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.van-goods-action-button {
|
.van-goods-action-button {
|
||||||
.theme(height, '@goods-action-button-height') !important;
|
.theme(--button-warning-background-color, '@goods-action-button-warning-color');
|
||||||
.theme(font-weight, '@font-weight-bold') !important;
|
.theme(--button-danger-background-color, '@goods-action-button-danger-color');
|
||||||
.theme(line-height, '@goods-action-button-height') !important;
|
.theme(--button-default-height, '@goods-action-button-height');
|
||||||
|
.theme(--button-line-height, '@goods-action-button-height');
|
||||||
|
.theme(--button-plain-background-color, '@goods-action-button-plain-color');
|
||||||
|
|
||||||
|
display: block;
|
||||||
|
|
||||||
|
--button-border-width: 0;
|
||||||
|
|
||||||
&--first {
|
&--first {
|
||||||
display: block !important;
|
|
||||||
margin-left: 5px;
|
margin-left: 5px;
|
||||||
.theme(border-top-left-radius, '@goods-action-button-border-radius') !important;
|
|
||||||
.theme(border-bottom-left-radius, '@goods-action-button-border-radius') !important;
|
.theme(
|
||||||
|
--button-border-radius,
|
||||||
|
'@goods-action-button-border-radius 0 0 @goods-action-button-border-radius'
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
&--last {
|
&--last {
|
||||||
display: block !important;
|
|
||||||
margin-right: 5px;
|
margin-right: 5px;
|
||||||
.theme(border-top-right-radius, '@goods-action-button-border-radius') !important;
|
.theme(
|
||||||
.theme(border-bottom-right-radius, '@goods-action-button-border-radius') !important;
|
--button-border-radius,
|
||||||
}
|
'0 @goods-action-button-border-radius @goods-action-button-border-radius 0'
|
||||||
|
);
|
||||||
&--warning {
|
|
||||||
.theme(background, '@goods-action-button-warning-color');
|
|
||||||
}
|
|
||||||
|
|
||||||
&--danger {
|
|
||||||
.theme(background, '@goods-action-button-danger-color');
|
|
||||||
}
|
|
||||||
|
|
||||||
&--ordinary {
|
|
||||||
border: none !important;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
&--plain {
|
&--plain {
|
||||||
.theme(background, '@goods-action-button-plain-color');
|
--button-border-width: @button-border-width;
|
||||||
}
|
}
|
||||||
|
|
||||||
&--no-right-border {
|
&__inner {
|
||||||
border-right-width: 0px !important;
|
width: 100%;
|
||||||
|
.theme(font-weight, '@font-weight-bold') !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (max-width: 321px) {
|
@media (max-width: 321px) {
|
||||||
|
@ -37,13 +37,8 @@ VantComponent({
|
|||||||
const { children = [] } = this.parent;
|
const { children = [] } = this.parent;
|
||||||
const { length } = children;
|
const { length } = children;
|
||||||
const index = children.indexOf(this);
|
const index = children.indexOf(this);
|
||||||
let rightBorderLess = false;
|
|
||||||
if (length > 1) {
|
|
||||||
rightBorderLess = index !== length - 1;
|
|
||||||
}
|
|
||||||
this.setData({
|
this.setData({
|
||||||
isFirst: index === 0,
|
isFirst: index === 0,
|
||||||
rightBorderLess,
|
|
||||||
isLast: index === length - 1
|
isLast: index === length - 1
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
<wxs src="../wxs/utils.wxs" module="utils" />
|
<wxs src="../wxs/utils.wxs" module="utils" />
|
||||||
<van-button
|
<van-button
|
||||||
square
|
|
||||||
id="{{ id }}"
|
id="{{ id }}"
|
||||||
lang="{{ lang }}"
|
lang="{{ lang }}"
|
||||||
type="{{ type }}"
|
type="{{ type }}"
|
||||||
@ -9,7 +8,8 @@
|
|||||||
loading="{{ loading }}"
|
loading="{{ loading }}"
|
||||||
disabled="{{ disabled }}"
|
disabled="{{ disabled }}"
|
||||||
open-type="{{ openType }}"
|
open-type="{{ openType }}"
|
||||||
custom-class="{{ utils.bem('goods-action-button', [type, { first: isFirst, last: isLast, plain : plain, ordinary: !plain }])}} {{ rightBorderLess ?'van-goods-action-button--no-right-border': ''}}"
|
class="{{ utils.bem('goods-action-button', [type, { first: isFirst, last: isLast, plain: plain }])}}"
|
||||||
|
custom-class="van-goods-action-button__inner"
|
||||||
business-id="{{ businessId }}"
|
business-id="{{ businessId }}"
|
||||||
session-from="{{ sessionFrom }}"
|
session-from="{{ sessionFrom }}"
|
||||||
app-parameter="{{ appParameter }}"
|
app-parameter="{{ appParameter }}"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user