diff --git a/src/Button/index.axml b/src/Button/index.axml index f3735aea7..2da607daa 100644 --- a/src/Button/index.axml +++ b/src/Button/index.axml @@ -14,7 +14,7 @@ catchTap="{{ catchTap ? 'catchTap' : '' }}" public-id="{{ publicId }}" open-type="{{ openType }}" - class="ant-button {{ inline ? 'ant-button-inline ' + utils.getClass(size) : '' }} {{ 'ant-button-' + type + (danger ? '-danger' : ( aide && ['default', 'primary'].indexOf(type) > -1 ? '-aide' : '' )) }} {{ disabled || loading ? 'ant-button-disabled' : '' }} {{ className ? className : '' }}" + class="ant-button {{ inline ? 'ant-button-inline ' + utils.getClass(size) : '' }} {{ 'ant-button-' + type + (danger ? '-danger' : (utils.isAide(aide, type) ? '-aide' : '' )) }} {{ disabled || loading ? 'ant-button-disabled' : '' }} {{ className ? className : '' }}" style="{{ style }}" > @@ -34,7 +34,7 @@ bindchooseavatar="onChooseAvatar" public-id="{{ publicId }}" open-type="{{ openType }}" - class="ant-button {{ inline ? 'ant-button-inline ' + utils.getClass(size) : '' }} {{ 'ant-button-' + type + (danger ? '-danger' : '') }} {{ disabled || loading ? 'ant-button-disabled' : '' }} {{ className ? className : '' }}" + class="ant-button {{ inline ? 'ant-button-inline ' + utils.getClass(size) : '' }} {{ 'ant-button-' + type + (danger ? '-danger' : (utils.isAide(aide, type) ? '-aide' : '' )) }} {{ disabled || loading ? 'ant-button-disabled' : '' }} {{ className ? className : '' }}" style="{{ style }}" > @@ -46,5 +46,15 @@ {{ subText }} + + + diff --git a/src/Button/index.sjs.ts b/src/Button/index.sjs.ts index 6b1104ed6..c99fd11f3 100644 --- a/src/Button/index.sjs.ts +++ b/src/Button/index.sjs.ts @@ -1,6 +1,6 @@ function getClass(size) { const list = ['small', 'medium', 'large']; - if (list.indexOf(size) >=0) { + if (list.indexOf(size) >= 0) { return `ant-button-${size}`; } return 'ant-button-medium'; @@ -20,5 +20,8 @@ function getHoverClass(loading, type, activeClassName) { return className; } +function isAide(aide, type) { + return aide && ['default', 'primary'].indexOf(type) > -1; +} -export default { getClass, getHoverClass }; +export default { getClass, getHoverClass, isAide }; diff --git a/src/Button/index.ts b/src/Button/index.ts index daeca5ef1..73b2e23e1 100644 --- a/src/Button/index.ts +++ b/src/Button/index.ts @@ -29,6 +29,10 @@ Component({ type: String, value: 'default', }, + aide: { + type: Boolean, + value: false, + }, }, options: { styleIsolation: 'shared',