diff --git a/src/components/BackToTop/index.vue b/src/components/BackToTop/index.vue new file mode 100644 index 00000000..10aaef1b --- /dev/null +++ b/src/components/BackToTop/index.vue @@ -0,0 +1,92 @@ + + + + + diff --git a/src/router/index.js b/src/router/index.js index 7f20b766..0d476f2f 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -28,6 +28,7 @@ const Sticky = _import('components/sticky'); const SplitPane = _import('components/splitpane'); const CountTo = _import('components/countTo'); const Mixin = _import('components/mixin'); +const BackToTop = _import('components/backToTop') /* charts */ const chartIndex = _import('charts/index'); @@ -129,7 +130,8 @@ export const asyncRouterMap = [ { path: 'dropzone', component: Dropzone, name: 'Dropzone' }, { path: 'sticky', component: Sticky, name: 'Sticky' }, { path: 'countto', component: CountTo, name: 'CountTo' }, - { path: 'mixin', component: Mixin, name: '小组件' } + { path: 'mixin', component: Mixin, name: '小组件' }, + { path: 'backtotop', component: BackToTop, name: '返回顶部' } ] }, { diff --git a/src/views/components/backToTop.vue b/src/views/components/backToTop.vue new file mode 100644 index 00000000..b20bbcfe --- /dev/null +++ b/src/views/components/backToTop.vue @@ -0,0 +1,143 @@ + + +