Merge remote-tracking branch 'main/dev' into dev

This commit is contained in:
陈嘉涵 2017-08-09 16:21:55 +08:00
commit 0c542f1bae
7 changed files with 43 additions and 16 deletions

View File

@ -1,5 +1,12 @@
## 更新日志
## [v0.7.6](https://github.com/youzan/vant/tree/v0.7.6) (2017-08-08)
[Full Changelog](https://github.com/youzan/vant/compare/v0.7.5...v0.7.6)
**非兼容更新和新特性:**
- 新增几个icon [\#69](https://github.com/youzan/vant/pull/69) ([cookfront](https://github.com/cookfront))
## [v0.7.5](https://github.com/youzan/vant/tree/v0.7.5) (2017-08-08)
[Full Changelog](https://github.com/youzan/vant/compare/v0.7.3...v0.7.5)

View File

@ -1,6 +1,6 @@
{
"name": "vant",
"version": "0.7.6",
"version": "0.7.7",
"description": "有赞vue wap组件库",
"main": "lib/vant.js",
"style": "lib/vant-css/index.css",

View File

@ -69,12 +69,6 @@ extend(Scroll.prototype, {
var leftOffset = offset - wrapWidth;
var rightOffset = offset + wrapWidth;
page = this.getCurrentPage();
if (page) {
page.style['-webkit-transform'] = 'translate3d(' + offset + 'px, 0, 0)';
page.style['display'] = 'block';
}
leftPage = this.pages[this.mapLoopPage(currentOffsetPage - 1)];
if (leftPage) {
if (Math.abs(leftOffset) <= wrapWidth) {
@ -96,6 +90,12 @@ extend(Scroll.prototype, {
}
}
}
page = this.getCurrentPage();
if (page) {
page.style['-webkit-transform'] = 'translate3d(' + offset + 'px, 0, 0)';
page.style['display'] = 'block';
}
},
movePage: function(dist, isEnd) {

View File

@ -10,6 +10,13 @@ export default {
beforeCreate() {
this.$parent.swipes.push(this);
},
destroyed() {
const index = this.$parent.swipes.indexOf(this)
if (index > -1) {
this.$parent.swipes.splice(index, 1)
}
}
};
</script>

View File

@ -36,11 +36,6 @@ export default {
},
mounted() {
const pages = this.$el.querySelectorAll('.van-swipe-item')
if (pages.length <= 1) {
return
}
this.input = new Input(this.$el, {
listenMoving: true
});
@ -66,10 +61,28 @@ export default {
}).on('autoPlay', function(dist, isEnd) {
scroll.movePage(dist.x, isEnd);
});
this.dummy = dummy
},
updated() {
this.scroll.update();
watch: {
swipes(value) {
if (this.autoPlay && value.length > 1) {
this.dummy.initMove()
} else {
this.dummy.clearMove()
}
this.scroll.update();
return value
},
autoPlay(value) {
if (value && this.swipes.length > 1) {
this.dummy.initMove()
} else {
this.dummy.clearMove()
}
return value
}
},
methods: {

View File

@ -1,6 +1,6 @@
{
"name": "vant-css",
"version": "0.7.6",
"version": "0.7.7",
"description": "vant css.",
"main": "lib/index.css",
"style": "lib/index.css",

View File

@ -37,7 +37,7 @@ import Swipe from '../packages/swipe/index.js';
import SwipeItem from '../packages/swipe-item/index.js';
import DatetimePicker from '../packages/datetime-picker/index.js';
const version = '0.7.6';
const version = '0.7.7';
const components = [
Button,
Switch,