diff --git a/dist/cell/index.wxss b/dist/cell/index.wxss index c7edbbd3..0b565598 100644 --- a/dist/cell/index.wxss +++ b/dist/cell/index.wxss @@ -1 +1 @@ -@import '../common/index.wxss';.van-cell{width:100%;display:-webkit-flex;display:flex;padding:10px 15px;box-sizing:border-box;line-height:24px;position:relative;background-color:#fff;color:#333;font-size:14px}.van-cell::after{content:' ';position:absolute;pointer-events:none;box-sizing:border-box;-webkit-transform-origin:center;transform-origin:center;top:auto;left:15px;right:0;bottom:0;-webkit-transform:scaleY(.5);transform:scaleY(.5);border-bottom:1px solid #eee}.van-cell--borderless::after{display:none}.van-cell-group{background-color:#fff}.van-cell__label{font-size:12px;line-height:18px;color:#7d7e80}.van-cell__title,.van-cell__value{-webkit-flex:1;flex:1}.van-cell__title:empty,.van-cell__value:empty{display:none}.van-cell__value{overflow:hidden;text-align:right;vertical-align:middle}.van-cell__left-icon-wrap,.van-cell__right-icon-wrap{display:-webkit-flex;display:flex;-webkit-align-items:center;align-items:center;height:24px;font-size:16px}.van-cell__left-icon-wrap{margin-right:5px}.van-cell__right-icon-wrap{margin-left:5px;color:#999}.van-cell__left-icon{line-height:24px;vertical-align:middle}.van-cell__right-icon{line-height:24px}.van-cell--clickable:active{background-color:#e8e8e8}.van-cell--required{overflow:visible}.van-cell--required::before{content:'*';position:absolute;left:7px;font-size:14px;color:#f44}.van-cell--center{-webkit-align-items:center;align-items:center}.van-cell--large{padding-top:12px;padding-bottom:12px}.van-cell--large .van-cell__title{font-size:16px} \ No newline at end of file +@import '../common/index.wxss';.van-cell{width:100%;display:-webkit-flex;display:flex;padding:10px 15px;box-sizing:border-box;line-height:24px;position:relative;background-color:#fff;color:#333;font-size:14px}.van-cell::after{content:' ';position:absolute;pointer-events:none;box-sizing:border-box;-webkit-transform-origin:center;transform-origin:center;top:auto;left:15px;right:0;bottom:0;-webkit-transform:scaleY(.5);transform:scaleY(.5);border-bottom:1px solid #eee}.van-cell--borderless::after{display:none}.van-cell-group{background-color:#fff}.van-cell__label{color:#999;font-size:12px;margin-top:3px;line-height:18px}.van-cell__title,.van-cell__value{-webkit-flex:1;flex:1}.van-cell__title:empty,.van-cell__value:empty{display:none}.van-cell__value{color:#999;overflow:hidden;text-align:right;vertical-align:middle}.van-cell__left-icon-wrap,.van-cell__right-icon-wrap{display:-webkit-flex;display:flex;-webkit-align-items:center;align-items:center;height:24px;font-size:16px}.van-cell__left-icon-wrap{margin-right:5px}.van-cell__right-icon-wrap{margin-left:5px;color:#999}.van-cell__left-icon{line-height:24px;vertical-align:middle}.van-cell__right-icon{line-height:24px}.van-cell--clickable:active{background-color:#e8e8e8}.van-cell--required{overflow:visible}.van-cell--required::before{content:'*';position:absolute;left:7px;font-size:14px;color:#f44}.van-cell--center{-webkit-align-items:center;align-items:center}.van-cell--large{padding-top:12px;padding-bottom:12px}.van-cell--large .van-cell__title{font-size:16px}.van-cell--large .van-cell__label{font-size:14px} \ No newline at end of file diff --git a/dist/collapse-item/index.js b/dist/collapse-item/index.js index a218e377..afe1fc35 100644 --- a/dist/collapse-item/index.js +++ b/dist/collapse-item/index.js @@ -28,6 +28,12 @@ VantComponent({ contentHeight: 0, expanded: false }, + beforeCreate: function beforeCreate() { + this.animation = wx.createAnimation({ + duration: 300, + timingFunction: 'ease-in-out' + }); + }, methods: { updateExpanded: function updateExpanded() { if (!this.parent) { @@ -54,15 +60,27 @@ VantComponent({ }); }, updateStyle: function updateStyle(expanded) { - if (expanded) { - this.set({ - contentHeight: 'auto' - }); - } else { - this.set({ - contentHeight: 0 - }); - } + var _this = this; + + this.getRect('.van-collapse-item__content').then(function (res) { + var animationData = _this.animation.height(expanded ? res.height : 0).step().export(); + + if (expanded) { + _this.set({ + animationData: animationData + }); + } else { + _this.set({ + contentHeight: res.height + 'px' + }, function () { + setTimeout(function () { + _this.set({ + animationData: animationData + }); + }, 20); + }); + } + }); }, onClick: function onClick() { if (this.data.disabled) { @@ -75,6 +93,13 @@ VantComponent({ var index = this.parent.data.items.indexOf(this); var currentName = name == null ? index : name; this.parent.switch(currentName, !expanded); + }, + onTransitionEnd: function onTransitionEnd() { + if (this.data.expanded) { + this.set({ + contentHeight: 'auto' + }); + } } } }); \ No newline at end of file diff --git a/dist/collapse-item/index.wxml b/dist/collapse-item/index.wxml index 4f51da13..b6ffedd9 100644 --- a/dist/collapse-item/index.wxml +++ b/dist/collapse-item/index.wxml @@ -29,7 +29,9 @@ </van-cell> <view class="van-collapse-item__wrapper" - style="max-height: {{ contentHeight }};" + style="height: {{ contentHeight }};" + animation="{{ animationData }}" + bind:transitionend="onTransitionEnd" > <view class="van-collapse-item__content content-class" diff --git a/dist/collapse-item/index.wxss b/dist/collapse-item/index.wxss index 693cdc52..8d0a134c 100644 --- a/dist/collapse-item/index.wxss +++ b/dist/collapse-item/index.wxss @@ -1 +1 @@ -@import '../common/index.wxss';.van-collapse-item__title .van-cell__right-icon{-webkit-transform:rotate(90deg);transform:rotate(90deg);transition:.3s}.van-collapse-item__title--expanded .van-cell__right-icon{-webkit-transform:rotate(-90deg);transform:rotate(-90deg)}.van-collapse-item__title--disabled .van-cell,.van-collapse-item__title--disabled .van-cell__right-icon{color:#c9c9c9!important}.van-collapse-item__title--disabled .van-cell:active{background-color:#fff!important}.van-collapse-item__wrapper{overflow:hidden;will-change:max-height;transition:max-height .3s ease-in-out}.van-collapse-item__content{color:#999;padding:15px;font-size:13px;line-height:1.5;background-color:#fff} \ No newline at end of file +@import '../common/index.wxss';.van-collapse-item__title .van-cell__right-icon{-webkit-transform:rotate(90deg);transform:rotate(90deg);transition:.3s}.van-collapse-item__title--expanded .van-cell__right-icon{-webkit-transform:rotate(-90deg);transform:rotate(-90deg)}.van-collapse-item__title--disabled .van-cell,.van-collapse-item__title--disabled .van-cell__right-icon{color:#c9c9c9!important}.van-collapse-item__title--disabled .van-cell:active{background-color:#fff!important}.van-collapse-item__wrapper{overflow:hidden}.van-collapse-item__content{color:#999;padding:15px;font-size:13px;line-height:1.5;background-color:#fff} \ No newline at end of file diff --git a/dist/field/index.wxml b/dist/field/index.wxml index e1205906..68326bdf 100644 --- a/dist/field/index.wxml +++ b/dist/field/index.wxml @@ -25,7 +25,7 @@ auto-height="{{ autosize }}" placeholder="{{ placeholder }}" placeholder-style="{{ placeholderStyle }}" - placeholder-class="{{ error ? 'van-field__input--error' : '' }}" + placeholder-class="{{ error ? 'van-field__input--error' : 'van-field__placeholder' }}" cursor-spacing="{{ cursorSpacing }}" adjust-position="{{ adjustPosition }}" show-confirm-bar="{{ showConfirmBar }}" @@ -44,7 +44,7 @@ maxlength="{{ maxlength }}" placeholder="{{ placeholder }}" placeholder-style="{{ placeholderStyle }}" - placeholder-class="{{ error ? 'van-field__input--error' : '' }}" + placeholder-class="{{ error ? 'van-field__input--error' : 'van-field__placeholder' }}" confirm-type="{{ confirmType }}" confirm-hold="{{ confirmHold }}" cursor-spacing="{{ cursorSpacing }}" diff --git a/dist/field/index.wxss b/dist/field/index.wxss index fdd253fa..db9a9eda 100644 --- a/dist/field/index.wxss +++ b/dist/field/index.wxss @@ -1 +1 @@ -@import '../common/index.wxss';.van-field__body{display:-webkit-flex;display:flex;-webkit-align-items:center;align-items:center}.van-field__body--textarea{min-height:24px}.van-field__input{border:0;margin:0;padding:0;width:100%;height:24px;resize:none;display:block;text-align:left;min-height:24px;line-height:inherit;box-sizing:border-box;background-color:transparent}.van-field__input--disabled{opacity:1;color:#7d7e80;background-color:transparent}.van-field__input--center{text-align:center}.van-field__input--right{text-align:right}.van-field__input--error{color:#f44}.van-field__clear-root{height:24px}.van-field__button,.van-field__clear,.van-field__icon-container{-webkit-flex-shrink:0;flex-shrink:0}.van-field__clear,.van-field__icon-container{padding:0 10px;line-height:inherit;margin-right:-10px;vertical-align:middle}.van-field__clear{color:#c9c9c9}.van-field__icon-container{color:#999}.van-field__icon{display:block!important}.van-field__button{padding-left:10px}.van-field__error-message{color:#f44;font-size:12px;text-align:left} \ No newline at end of file +@import '../common/index.wxss';.van-field__body{display:-webkit-flex;display:flex;-webkit-align-items:center;align-items:center}.van-field__body--textarea{min-height:24px}.van-field__input{border:0;margin:0;padding:0;width:100%;height:24px;resize:none;display:block;text-align:left;min-height:24px;color:#333;line-height:inherit;box-sizing:border-box;background-color:transparent}.van-field__input--disabled{opacity:1;color:#999;background-color:transparent}.van-field__input--center{text-align:center}.van-field__input--right{text-align:right}.van-field__input--error{color:#f44}.van-field__placeholder{color:#999}.van-field__clear-root{height:24px}.van-field__button,.van-field__clear,.van-field__icon-container{-webkit-flex-shrink:0;flex-shrink:0}.van-field__clear,.van-field__icon-container{padding:0 10px;line-height:inherit;margin-right:-10px;vertical-align:middle}.van-field__clear{color:#c9c9c9}.van-field__icon-container{color:#999}.van-field__icon{display:block!important}.van-field__button{padding-left:10px}.van-field__error-message{color:#f44;font-size:12px;text-align:left} \ No newline at end of file diff --git a/dist/icon/index.wxss b/dist/icon/index.wxss index d67654a5..53199c2e 100644 --- a/dist/icon/index.wxss +++ b/dist/icon/index.wxss @@ -1 +1 @@ -@import '../common/index.wxss';@font-face{font-style:normal;font-weight:400;font-family:vant-icon;src:url(https://img.yzcdn.cn/vant/vant-icon-ccd101.ttf) format('truetype')}.van-icon{position:relative;display:inline-block;font:normal normal normal 14px/1 vant-icon;font-size:inherit;text-rendering:auto}.van-icon--image{width:1em;height:1em}.van-icon--image image{top:0;left:0;right:0;bottom:0;margin:auto;max-width:100%;max-height:100%;position:absolute}.van-icon::before{display:inline-block}.van-icon-add-o::before{content:"\F000"}.van-icon-add::before{content:"\F001"}.van-icon-add2::before{content:"\F002"}.van-icon-after-sale::before{content:"\F003"}.van-icon-aim::before{content:"\F004"}.van-icon-alipay::before{content:"\F005"}.van-icon-arrow-down::before{content:"\F006"}.van-icon-arrow-left::before{content:"\F007"}.van-icon-arrow-up::before{content:"\F008"}.van-icon-arrow::before{content:"\F009"}.van-icon-balance-pay::before{content:"\F00A"}.van-icon-browsing-history::before{content:"\F00B"}.van-icon-card::before{content:"\F00C"}.van-icon-cart-o::before{content:"\F00D"}.van-icon-cart::before{content:"\F00E"}.van-icon-cash-back-record::before{content:"\F00F"}.van-icon-cash-on-deliver::before{content:"\F010"}.van-icon-certificate::before{content:"\F011"}.van-icon-chat::before{content:"\F012"}.van-icon-check::before{content:"\F013"}.van-icon-checked::before{content:"\F014"}.van-icon-clear::before{content:"\F015"}.van-icon-clock::before{content:"\F016"}.van-icon-close::before{content:"\F017"}.van-icon-completed::before{content:"\F018"}.van-icon-contact::before{content:"\F019"}.van-icon-coupon::before{content:"\F01A"}.van-icon-credit-pay::before{content:"\F01B"}.van-icon-cross::before{content:"\F01C"}.van-icon-debit-pay::before{content:"\F01D"}.van-icon-delete::before{content:"\F01E"}.van-icon-description::before{content:"\F01F"}.van-icon-discount::before{content:"\F020"}.van-icon-ecard-pay::before{content:"\F021"}.van-icon-edit-data::before{content:"\F022"}.van-icon-edit::before{content:"\F023"}.van-icon-exchange-record::before{content:"\F024"}.van-icon-exchange::before{content:"\F025"}.van-icon-fail::before{content:"\F026"}.van-icon-free-postage::before{content:"\F027"}.van-icon-gift-card-pay::before{content:"\F028"}.van-icon-gift-card::before{content:"\F029"}.van-icon-gift::before{content:"\F02A"}.van-icon-gold-coin::before{content:"\F02B"}.van-icon-goods-collect::before{content:"\F02C"}.van-icon-home::before{content:"\F02D"}.van-icon-hot-sale::before{content:"\F02E"}.van-icon-hot::before{content:"\F02F"}.van-icon-idcard::before{content:"\F030"}.van-icon-info-o::before{content:"\F031"}.van-icon-like-o::before{content:"\F032"}.van-icon-like::before{content:"\F033"}.van-icon-location::before{content:"\F034"}.van-icon-logistics::before{content:"\F035"}.van-icon-more-o::before{content:"\F036"}.van-icon-more::before{content:"\F037"}.van-icon-new-arrival::before{content:"\F038"}.van-icon-new::before{content:"\F039"}.van-icon-other-pay::before{content:"\F03A"}.van-icon-passed::before{content:"\F03B"}.van-icon-password-not-view::before{content:"\F03C"}.van-icon-password-view::before{content:"\F03D"}.van-icon-pause::before{content:"\F03E"}.van-icon-peer-pay::before{content:"\F03F"}.van-icon-pending-deliver::before{content:"\F040"}.van-icon-pending-evaluate::before{content:"\F041"}.van-icon-pending-orders::before{content:"\F042"}.van-icon-pending-payment::before{content:"\F043"}.van-icon-phone::before{content:"\F044"}.van-icon-photo::before{content:"\F045"}.van-icon-photograph::before{content:"\F046"}.van-icon-play::before{content:"\F047"}.van-icon-point-gift::before{content:"\F048"}.van-icon-points-mall::before{content:"\F049"}.van-icon-points::before{content:"\F04A"}.van-icon-qr-invalid::before{content:"\F04B"}.van-icon-qr::before{content:"\F04C"}.van-icon-question::before{content:"\F04D"}.van-icon-question2::before{content:"\F04E"}.van-icon-receive-gift::before{content:"\F04F"}.van-icon-records::before{content:"\F050"}.van-icon-search::before{content:"\F051"}.van-icon-send-gift::before{content:"\F052"}.van-icon-setting::before{content:"\F053"}.van-icon-share::before{content:"\F054"}.van-icon-shop-collect::before{content:"\F055"}.van-icon-shop::before{content:"\F056"}.van-icon-shopping-cart::before{content:"\F057"}.van-icon-sign::before{content:"\F058"}.van-icon-star-o::before{content:"\F059"}.van-icon-star::before{content:"\F05A"}.van-icon-stop::before{content:"\F05B"}.van-icon-success::before{content:"\F05C"}.van-icon-tosend::before{content:"\F05D"}.van-icon-underway::before{content:"\F05E"}.van-icon-upgrade::before{content:"\F05F"}.van-icon-value-card::before{content:"\F060"}.van-icon-wap-home::before{content:"\F061"}.van-icon-wap-nav::before{content:"\F062"}.van-icon-warn::before{content:"\F063"}.van-icon-wechat::before{content:"\F064"} \ No newline at end of file +@import '../common/index.wxss';@font-face{font-style:normal;font-weight:400;font-family:vant-icon;src:url(//img.yzcdn.cn/vant/vant-icon-776fa2.woff2) format('woff2'),url(//img.yzcdn.cn/vant/vant-icon-776fa2.woff) format('woff'),url(//img.yzcdn.cn/vant/vant-icon-776fa2.ttf) format('truetype')}.van-icon{position:relative;display:inline-block;font:normal normal normal 14px/1 vant-icon;font-size:inherit;text-rendering:auto;-webkit-font-smoothing:antialiased}.van-icon::before{display:inline-block}.van-icon-add-o:before{content:"\F000"}.van-icon-add-square:before{content:"\F001"}.van-icon-add:before{content:"\F002"}.van-icon-after-sale:before{content:"\F003"}.van-icon-aim:before{content:"\F004"}.van-icon-alipay:before{content:"\F005"}.van-icon-apps-o:before{content:"\F006"}.van-icon-arrow-down:before{content:"\F007"}.van-icon-arrow-left:before{content:"\F008"}.van-icon-arrow-up:before{content:"\F009"}.van-icon-arrow:before{content:"\F00A"}.van-icon-award-o:before{content:"\F00B"}.van-icon-award:before{content:"\F00C"}.van-icon-bag-o:before{content:"\F00D"}.van-icon-bag:before{content:"\F00E"}.van-icon-balance-list-o:before{content:"\F00F"}.van-icon-balance-list:before{content:"\F010"}.van-icon-balance-o:before{content:"\F011"}.van-icon-balance-pay:before{content:"\F012"}.van-icon-bar-chart-o:before{content:"\F013"}.van-icon-bars:before{content:"\F014"}.van-icon-bell:before{content:"\F015"}.van-icon-bill-o:before{content:"\F016"}.van-icon-bill:before{content:"\F017"}.van-icon-birthday-cake-o:before{content:"\F018"}.van-icon-bookmark-o:before{content:"\F019"}.van-icon-bookmark:before{content:"\F01A"}.van-icon-browsing-history-o:before{content:"\F01B"}.van-icon-browsing-history:before{content:"\F01C"}.van-icon-brush-o:before{content:"\F01D"}.van-icon-bulb-o:before{content:"\F01E"}.van-icon-bullhorn-o:before{content:"\F01F"}.van-icon-calender-o:before{content:"\F020"}.van-icon-card:before{content:"\F021"}.van-icon-cart-o:before{content:"\F022"}.van-icon-cart:before{content:"\F023"}.van-icon-cash-back-record:before{content:"\F024"}.van-icon-cash-on-deliver:before{content:"\F025"}.van-icon-cashier-o:before{content:"\F026"}.van-icon-certificate:before{content:"\F027"}.van-icon-chart-trending-o:before{content:"\F028"}.van-icon-chat-o:before{content:"\F029"}.van-icon-chat:before{content:"\F02A"}.van-icon-checked:before{content:"\F02B"}.van-icon-circle:before{content:"\F02C"}.van-icon-clear:before{content:"\F02D"}.van-icon-clock-o:before{content:"\F02E"}.van-icon-clock:before{content:"\F02F"}.van-icon-close:before{content:"\F030"}.van-icon-closed-eye:before{content:"\F031"}.van-icon-cluster-o:before{content:"\F032"}.van-icon-cluster:before{content:"\F033"}.van-icon-comment-circle-o:before{content:"\F034"}.van-icon-comment-o:before{content:"\F035"}.van-icon-comment:before{content:"\F036"}.van-icon-completed:before{content:"\F037"}.van-icon-contact:before{content:"\F038"}.van-icon-coupon-o:before{content:"\F039"}.van-icon-coupon:before{content:"\F03A"}.van-icon-credit-pay:before{content:"\F03B"}.van-icon-cross:before{content:"\F03C"}.van-icon-debit-pay:before{content:"\F03D"}.van-icon-delete:before{content:"\F03E"}.van-icon-description:before{content:"\F03F"}.van-icon-desktop-o:before{content:"\F040"}.van-icon-diamond-o:before{content:"\F041"}.van-icon-diamond:before{content:"\F042"}.van-icon-discount:before{content:"\F043"}.van-icon-ecard-pay:before{content:"\F044"}.van-icon-edit:before{content:"\F045"}.van-icon-ellipsis:before{content:"\F046"}.van-icon-empty:before{content:"\F047"}.van-icon-envelop-o:before{content:"\F048"}.van-icon-exchange-record:before{content:"\F049"}.van-icon-exchange:before{content:"\F04A"}.van-icon-expand-o:before{content:"\F04B"}.van-icon-expand:before{content:"\F04C"}.van-icon-eye-o:before{content:"\F04D"}.van-icon-eye:before{content:"\F04E"}.van-icon-fail:before{content:"\F04F"}.van-icon-failure:before{content:"\F050"}.van-icon-filter-o:before{content:"\F051"}.van-icon-fire-o:before{content:"\F052"}.van-icon-fire:before{content:"\F053"}.van-icon-flag-o:before{content:"\F054"}.van-icon-flower-o:before{content:"\F055"}.van-icon-free-postage:before{content:"\F056"}.van-icon-friends-o:before{content:"\F057"}.van-icon-friends:before{content:"\F058"}.van-icon-gem-o:before{content:"\F059"}.van-icon-gem:before{content:"\F05A"}.van-icon-gift-card-o:before{content:"\F05B"}.van-icon-gift-card:before{content:"\F05C"}.van-icon-gift-o:before{content:"\F05D"}.van-icon-gift:before{content:"\F05E"}.van-icon-gold-coin-o:before{content:"\F05F"}.van-icon-gold-coin:before{content:"\F060"}.van-icon-goods-collect-o:before{content:"\F061"}.van-icon-goods-collect:before{content:"\F062"}.van-icon-home-o:before{content:"\F063"}.van-icon-hot-o:before{content:"\F064"}.van-icon-hot-sale-o:before{content:"\F065"}.van-icon-hot-sale:before{content:"\F066"}.van-icon-hot:before{content:"\F067"}.van-icon-hotel-o:before{content:"\F068"}.van-icon-idcard:before{content:"\F069"}.van-icon-info-o:before{content:"\F06A"}.van-icon-info:before{content:"\F06B"}.van-icon-label-o:before{content:"\F06C"}.van-icon-label:before{content:"\F06D"}.van-icon-like-o:before{content:"\F06E"}.van-icon-like:before{content:"\F06F"}.van-icon-location-o:before{content:"\F070"}.van-icon-location:before{content:"\F071"}.van-icon-logistics:before{content:"\F072"}.van-icon-manager-o:before{content:"\F073"}.van-icon-manager:before{content:"\F074"}.van-icon-map-marked:before{content:"\F075"}.van-icon-medel-o:before{content:"\F076"}.van-icon-medel:before{content:"\F077"}.van-icon-more-o:before{content:"\F078"}.van-icon-more:before{content:"\F079"}.van-icon-music-o:before{content:"\F07A"}.van-icon-new-arrival-o:before{content:"\F07B"}.van-icon-new-arrival:before{content:"\F07C"}.van-icon-new:before{content:"\F07D"}.van-icon-newspaper-o:before{content:"\F07E"}.van-icon-notes-o:before{content:"\F07F"}.van-icon-orders-o:before{content:"\F080"}.van-icon-other-pay:before{content:"\F081"}.van-icon-paid:before{content:"\F082"}.van-icon-passed:before{content:"\F083"}.van-icon-pause:before{content:"\F084"}.van-icon-peer-pay:before{content:"\F085"}.van-icon-pending-payment:before{content:"\F086"}.van-icon-phone-circle-o:before{content:"\F087"}.van-icon-phone-o:before{content:"\F088"}.van-icon-phone:before{content:"\F089"}.van-icon-photo-o:before{content:"\F08A"}.van-icon-photo:before{content:"\F08B"}.van-icon-photograph:before{content:"\F08C"}.van-icon-play:before{content:"\F08D"}.van-icon-plus:before{content:"\F08E"}.van-icon-point-gift-o:before{content:"\F08F"}.van-icon-point-gift:before{content:"\F090"}.van-icon-points:before{content:"\F091"}.van-icon-printer:before{content:"\F092"}.van-icon-qr-invalid:before{content:"\F093"}.van-icon-qr:before{content:"\F094"}.van-icon-question-o:before{content:"\F095"}.van-icon-question:before{content:"\F096"}.van-icon-records:before{content:"\F097"}.van-icon-refund-o:before{content:"\F098"}.van-icon-scan:before{content:"\F099"}.van-icon-search:before{content:"\F09A"}.van-icon-send-gift-o:before{content:"\F09B"}.van-icon-send-gift:before{content:"\F09C"}.van-icon-service-o:before{content:"\F09D"}.van-icon-service:before{content:"\F09E"}.van-icon-setting-o:before{content:"\F09F"}.van-icon-setting:before{content:"\F0A0"}.van-icon-share:before{content:"\F0A1"}.van-icon-shop-collect-o:before{content:"\F0A2"}.van-icon-shop-collect:before{content:"\F0A3"}.van-icon-shop-o:before{content:"\F0A4"}.van-icon-shop:before{content:"\F0A5"}.van-icon-shopping-cart-o:before{content:"\F0A6"}.van-icon-shopping-cart:before{content:"\F0A7"}.van-icon-sign:before{content:"\F0A8"}.van-icon-smile-comment-o:before{content:"\F0A9"}.van-icon-smile-comment:before{content:"\F0AA"}.van-icon-smile-o:before{content:"\F0AB"}.van-icon-star-o:before{content:"\F0AC"}.van-icon-star:before{content:"\F0AD"}.van-icon-stop:before{content:"\F0AE"}.van-icon-success:before{content:"\F0AF"}.van-icon-thumb-circle-o:before{content:"\F0B0"}.van-icon-todo-list-o:before{content:"\F0B1"}.van-icon-todo-list:before{content:"\F0B2"}.van-icon-tosend:before{content:"\F0B3"}.van-icon-tv-o:before{content:"\F0B4"}.van-icon-umbrella-circle:before{content:"\F0B5"}.van-icon-underway-o:before{content:"\F0B6"}.van-icon-underway:before{content:"\F0B7"}.van-icon-upgrade:before{content:"\F0B8"}.van-icon-user-circle-o:before{content:"\F0B9"}.van-icon-user-o:before{content:"\F0BA"}.van-icon-video-o:before{content:"\F0BB"}.van-icon-video:before{content:"\F0BC"}.van-icon-vip-card-o:before{content:"\F0BD"}.van-icon-vip-card:before{content:"\F0BE"}.van-icon-volume-o:before{content:"\F0BF"}.van-icon-volume:before{content:"\F0C0"}.van-icon-wap-home:before{content:"\F0C1"}.van-icon-wap-nav:before{content:"\F0C2"}.van-icon-warn-o:before{content:"\F0C3"}.van-icon-wechat:before{content:"\F0C4"}.van-icon-youzan-shield:before{content:"\F0C5"}.van-icon--image{width:1em;height:1em}.van-icon--image image{top:0;left:0;right:0;bottom:0;margin:auto;max-width:100%;max-height:100%;position:absolute} \ No newline at end of file diff --git a/dist/loading/index.wxml b/dist/loading/index.wxml index 0ee145fc..35ca0e22 100644 --- a/dist/loading/index.wxml +++ b/dist/loading/index.wxml @@ -9,7 +9,7 @@ <view wx:if="{{ type === 'spinner' }}" wx:for="item in 12" - wx:key="{{ index }}" + wx:key="index" class="van-loading__dot" /> </view> diff --git a/dist/notice-bar/index.wxml b/dist/notice-bar/index.wxml index a4ed4b31..67428222 100644 --- a/dist/notice-bar/index.wxml +++ b/dist/notice-bar/index.wxml @@ -17,7 +17,7 @@ <van-icon wx:if="{{ mode === 'closeable' }}" class="van-notice-bar__right-icon" - name="close" + name="cross" bind:tap="onClickIcon" /> <navigator diff --git a/dist/radio/index.wxml b/dist/radio/index.wxml index dc61d3fb..fde5f2e8 100644 --- a/dist/radio/index.wxml +++ b/dist/radio/index.wxml @@ -14,7 +14,7 @@ class="{{ utils.bem('radio__icon', { disabled, checked: !disabled && name === value, check: !disabled && name !== value }) }}" custom-class="icon-class" color="{{ value === name ? checkedColor : '' }}" - name="{{ value === name ? 'checked' : 'check' }}" + name="{{ value === name ? 'checked' : 'circle' }}" /> </view> <view class="van-radio__label van-radio__label--{{ labelPosition }} label-class" bindtap="onClickLabel"> diff --git a/dist/slider/index.js b/dist/slider/index.js index 1cc858b3..3509d4c0 100644 --- a/dist/slider/index.js +++ b/dist/slider/index.js @@ -4,6 +4,9 @@ VantComponent({ mixins: [touch], props: { disabled: Boolean, + useButtonSlot: Boolean, + activeColor: String, + inactiveColor: String, max: { type: Number, value: 100 @@ -70,6 +73,9 @@ VantComponent({ value: value, barStyle: "width: " + value + "%; height: " + this.data.barHeight + ";" }); + this.$emit('drag', { + value: value + }); if (end) { this.$emit('change', value); diff --git a/dist/slider/index.wxml b/dist/slider/index.wxml index 24b073bd..e57d1e9c 100644 --- a/dist/slider/index.wxml +++ b/dist/slider/index.wxml @@ -1,11 +1,27 @@ -<view class="custom-class van-slider {{ disabled ? 'van-slider--disabled' : '' }}" bind:tap="onClick"> - <view class="van-slider__bar" style="{{ barStyle }}"> +<view + class="custom-class van-slider {{ disabled ? 'van-slider--disabled' : '' }}" + style="{{ inactiveColor ? 'background:' + inactiveColor : '' }}" + bind:tap="onClick" +> + <view + class="van-slider__bar" + style="{{ barStyle }}; {{ activeColor ? 'background:' + activeColor : '' }}" + > <view - class="van-slider__button" + class="van-slider__button-wrapper" bind:touchstart="onTouchStart" catch:touchmove="onTouchMove" bind:touchend="onTouchEnd" bind:touchcancel="onTouchEnd" - /> + > + <slot + wx:if="{{ useButtonSlot }}" + name="button" + /> + <view + wx:else + class="van-slider__button" + /> + </view> </view> </view> diff --git a/dist/slider/index.wxss b/dist/slider/index.wxss index 7fa33328..41bffa66 100644 --- a/dist/slider/index.wxss +++ b/dist/slider/index.wxss @@ -1 +1 @@ -@import '../common/index.wxss';.van-slider{position:relative;border-radius:999px;background-color:#e5e5e5}.van-slider__bar{position:relative;border-radius:inherit;background-color:#1989fa}.van-slider__button{position:absolute;top:50%;right:0;width:20px;height:20px;border-radius:50%;background-color:#fff;-webkit-transform:translate3d(50%,-50%,0);transform:translate3d(50%,-50%,0);box-shadow:0 1px 2px rgba(0,0,0,.5)}.van-slider__button::after{content:'';position:absolute;width:200%;height:200%;top:-50%;left:-50%}.van-slider--disabled{opacity:.3} \ No newline at end of file +@import '../common/index.wxss';.van-slider{position:relative;border-radius:999px;background-color:#e5e5e5}.van-slider__bar{position:relative;border-radius:inherit;background-color:#1989fa}.van-slider__button{width:20px;height:20px;border-radius:50%;background-color:#fff;box-shadow:0 1px 2px rgba(0,0,0,.5)}.van-slider__button-wrapper{position:absolute;top:50%;right:0;-webkit-transform:translate3d(50%,-50%,0);transform:translate3d(50%,-50%,0)}.van-slider__button-wrapper::after{content:'';position:absolute;width:200%;height:200%;top:-50%;left:-50%}.van-slider--disabled{opacity:.3} \ No newline at end of file diff --git a/dist/stepper/index.js b/dist/stepper/index.js index 56a366f9..aca51de6 100644 --- a/dist/stepper/index.js +++ b/dist/stepper/index.js @@ -9,6 +9,7 @@ VantComponent({ value: Number, integer: Boolean, disabled: Boolean, + asyncChange: Boolean, disableInput: Boolean, min: { type: null, @@ -87,7 +88,7 @@ VantComponent({ }, triggerInput: function triggerInput(value) { this.set({ - value: value + value: this.data.asyncChange ? this.data.value : value }); this.$emit('change', value); } diff --git a/dist/tab/index.wxml b/dist/tab/index.wxml index cb6c494e..7a926640 100644 --- a/dist/tab/index.wxml +++ b/dist/tab/index.wxml @@ -1,6 +1,6 @@ <view wx:if="{{ animated || inited }}" - class="custom-class van-tab__pane {{ animated ? 'van-tab__pane--float' : '' }}" + class="custom-class van-tab__pane {{ active ? 'van-tab__pane--active' : 'van-tab__pane--inactive' }}" style="{{ animated || active ? '' : 'display: none;' }} {{ width ? 'width:' + width + 'px;' : '' }}" > <slot /> diff --git a/dist/tab/index.wxss b/dist/tab/index.wxss index 9d7a1a58..e2e67a98 100644 --- a/dist/tab/index.wxss +++ b/dist/tab/index.wxss @@ -1 +1 @@ -@import '../common/index.wxss';.van-tab__pane{box-sizing:border-box}.van-tab__pane--float{float:left} \ No newline at end of file +@import '../common/index.wxss';.van-tab__pane{box-sizing:border-box;overflow-y:auto}.van-tab__pane--active{height:auto}.van-tab__pane--inactive{height:0;overflow:visible} \ No newline at end of file diff --git a/dist/tabbar-item/index.js b/dist/tabbar-item/index.js index 7e6a375d..2a833320 100644 --- a/dist/tabbar-item/index.js +++ b/dist/tabbar-item/index.js @@ -22,10 +22,14 @@ VantComponent({ this.$emit('click'); }, - setActive: function setActive(active) { + setActive: function setActive(_ref) { + var active = _ref.active, + color = _ref.color; + if (this.data.active !== active) { this.set({ - active: active + active: active, + color: color }); } } diff --git a/dist/tabbar-item/index.wxml b/dist/tabbar-item/index.wxml index 6f7251f1..cae5dcda 100644 --- a/dist/tabbar-item/index.wxml +++ b/dist/tabbar-item/index.wxml @@ -1,5 +1,6 @@ <view class="van-tabbar-item {{ active ? 'van-tabbar-item--active' : '' }}" + style="{{ active && color ? 'color: ' + color : '' }}" bind:tap="onClick" > <view class="van-tabbar-item__icon {{ dot ? 'van-tabbar-item__icon--dot' : '' }}"> diff --git a/dist/tabbar/index.js b/dist/tabbar/index.js index b14afdd6..441625e6 100644 --- a/dist/tabbar/index.js +++ b/dist/tabbar/index.js @@ -26,6 +26,7 @@ VantComponent({ }, props: { active: Number, + activeColor: String, fixed: { type: Boolean, value: true @@ -57,7 +58,10 @@ VantComponent({ var _this3 = this; this.data.items.forEach(function (item, index) { - item.setActive(index === _this3.data.currentActive); + item.setActive({ + active: index === _this3.data.currentActive, + color: _this3.data.activeColor + }); }); }, onChange: function onChange(child) { diff --git a/dist/tabs/index.js b/dist/tabs/index.js index 8a41f2bc..3827ceda 100644 --- a/dist/tabs/index.js +++ b/dist/tabs/index.js @@ -160,7 +160,7 @@ VantComponent({ var width = rect.width; _this2.set({ - trackStyle: "\n width: " + width * _this2.child.length + "px;\n transform: translateX(" + -1 * active * width + "px);\n transition-duration: " + duration + "s;\n " + trackStyle: "\n width: " + width * _this2.child.length + "px;\n left: " + -1 * active * width + "px;\n transition: left " + duration + "s;\n display: flex;\n " }); _this2.setTabsProps({ diff --git a/dist/tabs/index.wxss b/dist/tabs/index.wxss index b9d28a0d..ad46a5cc 100644 --- a/dist/tabs/index.wxss +++ b/dist/tabs/index.wxss @@ -1 +1 @@ -@import '../common/index.wxss';.van-tabs{position:relative;-webkit-tap-highlight-color:transparent}.van-tabs__wrap{top:0;left:0;right:0;position:absolute}.van-tabs__wrap--page-top{position:fixed}.van-tabs__wrap--content-bottom{top:auto;bottom:0}.van-tabs__wrap--scrollable .van-tab{-webkit-flex:0 0 22%;flex:0 0 22%}.van-tabs__scroll--card{border:1px solid #f44;border-radius:2px}.van-tabs__nav{display:-webkit-flex;display:flex;-webkit-user-select:none;user-select:none;position:relative;background-color:#fff}.van-tabs__nav--line{height:100%}.van-tabs__nav--card{height:30px}.van-tabs__nav--card .van-tab{color:#f44;border-right:1px solid #f44;line-height:30px}.van-tabs__nav--card .van-tab:last-child{border-right:none}.van-tabs__nav--card .van-tab.van-tab--active{color:#fff;background-color:#f44}.van-tabs__line{z-index:1;left:0;bottom:0;height:2px;position:absolute;background-color:#f44;border-radius:2px}.van-tabs--line{padding-top:44px}.van-tabs--line .van-tabs__wrap{height:44px}.van-tabs--card{padding-top:30px;margin:0 15px}.van-tabs--card .van-tabs__wrap{height:30px}.van-tabs__content{overflow:hidden}.van-tab{-webkit-flex:1;flex:1;cursor:pointer;padding:0 5px;font-size:14px;position:relative;color:#7d7e80;line-height:44px;text-align:center;box-sizing:border-box;background-color:#fff;min-width:0}.van-tab span{display:block}.van-tab--active{font-weight:500;color:#333}.van-tab--disabled{color:#c9c9c9} \ No newline at end of file +@import '../common/index.wxss';.van-tabs{position:relative;-webkit-tap-highlight-color:transparent}.van-tabs__wrap{top:0;left:0;right:0;position:absolute}.van-tabs__wrap--page-top{position:fixed}.van-tabs__wrap--content-bottom{top:auto;bottom:0}.van-tabs__wrap--scrollable .van-tab{-webkit-flex:0 0 22%;flex:0 0 22%}.van-tabs__scroll--card{border:1px solid #f44;border-radius:2px}.van-tabs__nav{display:-webkit-flex;display:flex;-webkit-user-select:none;user-select:none;position:relative;background-color:#fff}.van-tabs__nav--line{height:100%}.van-tabs__nav--card{height:30px}.van-tabs__nav--card .van-tab{color:#f44;border-right:1px solid #f44;line-height:30px}.van-tabs__nav--card .van-tab:last-child{border-right:none}.van-tabs__nav--card .van-tab.van-tab--active{color:#fff;background-color:#f44}.van-tabs__line{z-index:1;left:0;bottom:0;height:2px;position:absolute;background-color:#f44;border-radius:2px}.van-tabs--line{padding-top:44px}.van-tabs--line .van-tabs__wrap{height:44px}.van-tabs--card{padding-top:30px;margin:0 15px}.van-tabs--card .van-tabs__wrap{height:30px}.van-tabs__content{overflow:hidden}.van-tabs__track{position:relative}.van-tab{-webkit-flex:1;flex:1;cursor:pointer;padding:0 5px;font-size:14px;position:relative;color:#7d7e80;line-height:44px;text-align:center;box-sizing:border-box;background-color:#fff;min-width:0}.van-tab--active{font-weight:500;color:#333}.van-tab--disabled{color:#c9c9c9} \ No newline at end of file diff --git a/dist/wxs/utils.wxs b/dist/wxs/utils.wxs index 5deffee0..8cced70f 100644 --- a/dist/wxs/utils.wxs +++ b/dist/wxs/utils.wxs @@ -2,7 +2,7 @@ var bem = require('./bem.wxs').bem; var memoize = require('./memoize.wxs').memoize; function isSrc(url) { - return url.indexOf('http') === 0 || url.indexOf('data:image') === 0; + return url.indexOf('http') === 0 || url.indexOf('data:image') === 0 || url.indexOf('//') === 0; } module.exports = {