Skip to content

Commit 95bbfe2

Browse files
committed
Back to top button design
1 parent 67135b7 commit 95bbfe2

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

src/App.vue

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,15 @@
88
<router-view :theme="appTheme" />
99
</transition>
1010

11+
<back-to-top
12+
visibleoffset="500"
13+
right="40px"
14+
bottom="40px"
15+
class="shadow-lg"
16+
>
17+
<i data-feather="arrow-up"></i>
18+
</back-to-top>
19+
1120
<!-- App footer -->
1221
<Footer></Footer>
1322
</div>
@@ -45,6 +54,13 @@ export default {
4554
text-align: center;
4655
}
4756
57+
.vue-back-to-top {
58+
@apply p-2 sm:p-4 bg-indigo-500 hover:bg-indigo-600 text-white;
59+
border-radius: 50%;
60+
font-size: 22px;
61+
line-height: 22px;
62+
}
63+
4864
.fade-enter-active {
4965
animation: coming 0.4s;
5066
animation-delay: 0.2s;

src/main.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,14 @@ import App from './App.vue';
33
import router from './router';
44
import './assets/css/tailwind.css';
55
import './assets/css/app.css';
6+
import BackToTop from 'vue-backtotop';
67

78
const feather = require('feather-icons');
89
feather.replace();
910

1011
createApp(App)
1112
.use(router)
13+
.use(BackToTop)
1214
.mount('#app');
1315

1416
const appTheme = localStorage.getItem('theme');

0 commit comments

Comments
 (0)