mirror of
https://github.com/bakateam/merakiui.git
synced 2025-12-10 07:25:34 +00:00
Remove jquary and use vue-backToTop
This commit is contained in:
@@ -11,11 +11,11 @@
|
|||||||
"autoprefixer": "^9.7.6",
|
"autoprefixer": "^9.7.6",
|
||||||
"core-js": "^3.6.4",
|
"core-js": "^3.6.4",
|
||||||
"highlight.js": "^10.0.2",
|
"highlight.js": "^10.0.2",
|
||||||
"jquery": "^3.5.1",
|
|
||||||
"js-beautify": "^1.11.0",
|
"js-beautify": "^1.11.0",
|
||||||
"tailwindcss": "^1.4.4",
|
"tailwindcss": "^1.4.4",
|
||||||
"vue": "^2.6.11",
|
"vue": "^2.6.11",
|
||||||
"vue-analytics": "^5.22.1",
|
"vue-analytics": "^5.22.1",
|
||||||
|
"vue-backtotop": "^1.6.1",
|
||||||
"vue-clipboard2": "^0.3.1"
|
"vue-clipboard2": "^0.3.1"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
|||||||
@@ -30,7 +30,13 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<goto-top></goto-top>
|
<back-to-top visibleoffset="800">
|
||||||
|
<button class="bg-gray-800 text-white fixed bottom-0 right-0 my-10 mx-10 p-2 rounded-md">
|
||||||
|
<svg class="h-6 w-6" viewBox="0 0 20 20" fill="currentColor">
|
||||||
|
<path fill-rule="evenodd" d="M14.707 12.707a1 1 0 01-1.414 0L10 9.414l-3.293 3.293a1 1 0 01-1.414-1.414l4-4a1 1 0 011.414 0l4 4a1 1 0 010 1.414z" clip-rule="evenodd"/>
|
||||||
|
</svg>
|
||||||
|
</button>
|
||||||
|
</back-to-top>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -72,9 +78,9 @@ import Pagination from "./UI/Paginations/Pagination";
|
|||||||
import SimpleFooter from "./UI/Footers/SimpleFooter";
|
import SimpleFooter from "./UI/Footers/SimpleFooter";
|
||||||
import FooterWithSubscribeForm from "./UI/Footers/FooterWithSubscribeForm";
|
import FooterWithSubscribeForm from "./UI/Footers/FooterWithSubscribeForm";
|
||||||
|
|
||||||
|
import BackToTop from 'vue-backtotop';
|
||||||
import Component from "../Models/Component";
|
import Component from "../Models/Component";
|
||||||
import ViewComponent from "./Utilities/ViewComponent";
|
import ViewComponent from "./Utilities/ViewComponent";
|
||||||
import GotoTop from "./Utilities/GotoTop";
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
@@ -114,7 +120,7 @@ export default {
|
|||||||
SimpleFooter,
|
SimpleFooter,
|
||||||
FooterWithSubscribeForm,
|
FooterWithSubscribeForm,
|
||||||
|
|
||||||
GotoTop,
|
BackToTop,
|
||||||
ViewComponent,
|
ViewComponent,
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
|
|||||||
@@ -1,24 +0,0 @@
|
|||||||
<template>
|
|
||||||
<a id="goToTop" href="#main" class="bg-gray-800 text-white fixed bottom-0 right-0 my-10 mx-10 p-2 rounded-md hidden">
|
|
||||||
<svg class="h-6 w-6" viewBox="0 0 20 20" fill="currentColor">
|
|
||||||
<path fill-rule="evenodd" d="M14.707 12.707a1 1 0 01-1.414 0L10 9.414l-3.293 3.293a1 1 0 01-1.414-1.414l4-4a1 1 0 011.414 0l4 4a1 1 0 010 1.414z" clip-rule="evenodd"/>
|
|
||||||
</svg>
|
|
||||||
</a>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import $ from "jquery";
|
|
||||||
|
|
||||||
export default {
|
|
||||||
mounted() {
|
|
||||||
$(document).scroll(function() {
|
|
||||||
let y = $(this).scrollTop();
|
|
||||||
if (y > 800) {
|
|
||||||
$('#goToTop').fadeIn();
|
|
||||||
} else {
|
|
||||||
$('#goToTop').fadeOut();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
Reference in New Issue
Block a user