Merge pull request #345 from DebugIsFalse/2.0-backtop

2.0 backtop
This commit is contained in:
Aresn 2017-03-07 10:36:34 +08:00 committed by GitHub
commit f24603ba58
6 changed files with 31 additions and 4 deletions

View file

@ -58,7 +58,7 @@
- [ ] LoadingBar
- [x] Circle
- [x] Affix
- [ ] BackTop
- [x] BackTop
- [x] Spin
## Overview

View file

@ -44,6 +44,7 @@ li + li { border-left: solid 1px #bbb; padding-left: 10px; margin-left: 10px; }
<li><router-link to="/spin">Spin</router-link></li>
<li><router-link to="/cascader">Cascader</router-link></li>
<li><router-link to="/select">Select</router-link></li>
<li><router-link to="/backtop">Backtop</router-link></li>
<li><router-link to="/page">Page</router-link></li>
</ul>
</nav>

View file

@ -141,6 +141,10 @@ const router = new VueRouter({
path: '/select',
component: require('./routers/select.vue')
},
{
path: '/backtop',
component: require('./routers/back-top.vue')
},
{
path: '/page',
component: require('./routers/page.vue')

View file

@ -0,0 +1,22 @@
<style>
body{
height: 2000px;
}
</style>
<template>
<BackTop>
</BackTop>
</template>
<script>
export default {
data(){
return {
}
},
mounted(){
}
}
</script>

View file

@ -35,7 +35,7 @@
backTop: false
};
},
ready () {
mounted () {
window.addEventListener('scroll', this.handleScroll, false);
window.addEventListener('resize', this.handleScroll, false);
},

View file

@ -3,7 +3,7 @@ import 'core-js/fn/array/find-index';
import Affix from './components/affix';
import Alert from './components/alert';
// import BackTop from './components/back-top';
import BackTop from './components/back-top';
import Badge from './components/badge';
import Breadcrumb from './components/breadcrumb';
import Button from './components/button';
@ -49,7 +49,7 @@ import locale from './locale';
const iview = {
Affix,
Alert,
// BackTop,
BackTop,
Badge,
Breadcrumb,
BreadcrumbItem: Breadcrumb.Item,