mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
Merge remote-tracking branch 'main/dev' into dev
This commit is contained in:
commit
0c542f1bae
@ -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)
|
||||
|
||||
|
@ -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",
|
||||
|
@ -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) {
|
||||
|
@ -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>
|
||||
|
@ -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: {
|
||||
|
@ -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",
|
||||
|
@ -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,
|
||||
|
Loading…
x
Reference in New Issue
Block a user