diff --git a/.stylelintrc b/.stylelintrc index b0aeb7027..7615757c2 100644 --- a/.stylelintrc +++ b/.stylelintrc @@ -2,6 +2,7 @@ "extends": "stylelint-config-standard", "plugins": ["stylelint-scss"], "rules": { + "declaration-colon-newline-after": null, "at-rule-no-unknown": null, "color-hex-case": null, "block-closing-brace-newline-after": null, diff --git a/src/common/utils.ts b/src/common/utils.ts index 8c4ac1960..53bf7b32a 100644 --- a/src/common/utils.ts +++ b/src/common/utils.ts @@ -53,7 +53,8 @@ function delayGetClientRect ({ selectorStr, delayTime = 500 }): Promise> { - const $scope = ENV === Taro.ENV_TYPE.WEB ? self : self.$scope + const $scope = + ENV === Taro.ENV_TYPE.WEB || ENV === Taro.ENV_TYPE.SWAN ? self : self.$scope const selector: SelectorQuery = Taro.createSelectorQuery().in($scope) return new Promise(resolve => { @@ -188,7 +189,7 @@ function initTestEnv () { } } -function isTest() { +function isTest () { return process.env.NODE_ENV === 'test' } @@ -214,7 +215,7 @@ function handleTouchScroll (flag) { } } -function pxTransform(size) { +function pxTransform (size) { if (!size) return '' return Taro.pxTransform(size) } diff --git a/src/components/toast/index.js b/src/components/toast/index.js index c3f18b93b..70c5e010b 100644 --- a/src/components/toast/index.js +++ b/src/components/toast/index.js @@ -107,7 +107,7 @@ export default class AtToast extends AtComponent { {hasMask && } - {realImg && ( + {realImg ? ( - )} + ) : null} {isRenderIcon && ( diff --git a/src/pages/action/toast/index.js b/src/pages/action/toast/index.js index f7726cf99..8405c4e51 100644 --- a/src/pages/action/toast/index.js +++ b/src/pages/action/toast/index.js @@ -24,14 +24,12 @@ export default class ToastPage extends Component { this.state = INIT_STATE } - handleClick = (text, icon, image, hasMask, status) => { + handleClick = params => { if (this.state.isOpened) { return this.setState(INIT_STATE) } - const state = Object.assign( - { ...INIT_STATE, isOpened: true }, - { text, icon, image, hasMask, status } - ) + + const state = Object.assign({ ...INIT_STATE, isOpened: true }, params) this.setState(state) } @@ -66,28 +64,19 @@ export default class ToastPage extends Component { 文本 Toast 文本 + ICON @@ -100,14 +89,11 @@ export default class ToastPage extends Component { 自定义图片 Toast @@ -120,14 +106,10 @@ export default class ToastPage extends Component { 添加遮罩层 Toast @@ -140,14 +122,11 @@ export default class ToastPage extends Component { 错误提示 Toast @@ -160,14 +139,11 @@ export default class ToastPage extends Component { 正确提示 Toast @@ -180,14 +156,11 @@ export default class ToastPage extends Component { 加载中 Toast diff --git a/src/style/components/calendar.scss b/src/style/components/calendar.scss index aa6989f53..09736e803 100644 --- a/src/style/components/calendar.scss +++ b/src/style/components/calendar.scss @@ -1,5 +1,5 @@ -@import '../mixins/index.scss'; -@import '../variables/default.scss'; +@import "../mixins/index.scss"; +@import "../variables/default.scss"; .at-calendar { overflow: hidden; @@ -109,7 +109,10 @@ background-color: transparent; .flex__item-container { - background-color: rgba($color: $at-calendar-main-color, $alpha: 0.7); + background-color: rgba( + $color: $at-calendar-main-color, + $alpha: 0.7 + ); } } } @@ -170,7 +173,8 @@ } } - &--weapp { + &--weapp, + &--swan { .main__body { height: 480px; }