update TimePicker & BackTop

update TimePicker & BackTop
This commit is contained in:
梁灏 2016-12-27 12:00:45 +08:00
parent 36628acaab
commit 2d94873892
9 changed files with 179 additions and 98 deletions

View file

@ -8,6 +8,7 @@
</div>
</template>
<script>
import { scrollTop } from '../../utils/assist';
const prefixCls = 'ivu-back-top';
export default {
@ -23,6 +24,10 @@
right: {
type: Number,
default: 30
},
duration: {
type: Number,
default: 1000
}
},
data () {
@ -62,7 +67,7 @@
this.backTop = window.pageYOffset >= this.height;
},
back () {
window.scrollTo(0, 0);
scrollTop(window, document.body.scrollTop, 0, this.duration);
this.$emit('on-click');
}
}