Scrolltotop added to plugin

pull/3420/head
Bahadir Sofuoglu 2022-09-12 13:35:24 +03:00
parent 3eac7d6658
commit a6de96f5fb
9 changed files with 28 additions and 11 deletions

View File

@ -48,7 +48,7 @@
</template> </template>
<script> <script>
import Quill from "quill"; //import Quill from "quill";
export default { export default {
name: 'Editor', name: 'Editor',

View File

@ -29,7 +29,7 @@ declare module '@vue/runtime-core' {
* *
* Demos: * Demos:
* *
* - [FullCalendar](https://www.primefaces.org/primevue/showcase/#/fullcalendar) * - [FullCalendar](https://www.primefaces.org/primevue/fullcalendar)
* *
* @deprecated * @deprecated
*/ */

View File

@ -4,7 +4,7 @@
<script> <script>
import '@fullcalendar/core/vdom'; // vite support import '@fullcalendar/core/vdom'; // vite support
import {Calendar} from '@fullcalendar/core'; import { Calendar } from '@fullcalendar/core';
export default { export default {
name: 'FullCalendar', name: 'FullCalendar',
@ -46,8 +46,8 @@ export default {
}, },
methods: { methods: {
initialize() { initialize() {
let defaultConfig = {themeSystem: 'standard'}; let defaultConfig = { themeSystem: 'standard' };
let config = this.options ? {...this.options, ...defaultConfig} : defaultConfig; let config = this.options ? { ...this.options, ...defaultConfig } : defaultConfig;
this.calendar = new Calendar(this.$el, config); this.calendar = new Calendar(this.$el, config);
this.calendar.render(); this.calendar.render();
@ -57,8 +57,7 @@ export default {
} }
} }
} }
} };
</script> </script>
<style> <style></style>
</style>

View File

@ -20,7 +20,7 @@ export default defineNuxtConfig({
rel: 'stylesheet', rel: 'stylesheet',
href: './styles/landing/themes/lara-light-blue/theme.css' href: './styles/landing/themes/lara-light-blue/theme.css'
} }
] ],
}, },
}, },
css: [ css: [

View File

@ -106,7 +106,7 @@ export default {
} }
}, },
mounted() { mounted() {
this.setAnimation = true this.setAnimation = true
}, },
methods: { methods: {
navigateTo(url) { navigateTo(url) {

View File

@ -152,7 +152,7 @@ nuxtApp.vueApp.component('Dropdown', Dropdown);
/* nuxtApp.vueApp.component('Editor', Editor); */ /* nuxtApp.vueApp.component('Editor', Editor); */
nuxtApp.vueApp.component('Fieldset', Fieldset); nuxtApp.vueApp.component('Fieldset', Fieldset);
nuxtApp.vueApp.component('FileUpload', FileUpload); nuxtApp.vueApp.component('FileUpload', FileUpload);
nuxtApp.vueApp.component('FullCalendar', FullCalendar); //nuxtApp.vueApp.component('FullCalendar', FullCalendar);
nuxtApp.vueApp.component('Image', Image); nuxtApp.vueApp.component('Image', Image);
nuxtApp.vueApp.component('InlineMessage', InlineMessage); nuxtApp.vueApp.component('InlineMessage', InlineMessage);
nuxtApp.vueApp.component('Inplace', Inplace); nuxtApp.vueApp.component('Inplace', Inplace);

9
plugins/scrollToTop.js Normal file
View File

@ -0,0 +1,9 @@
export default defineNuxtPlugin((nuxtApp) => {
nuxtApp.$router.options.scrollBehavior = (to, from, savedPosition) => {
return new Promise((resolve, reject) => {
setTimeout(() => {
resolve({ left: 0, top: 0, behaviour: "smooth" });
}, 100);
});
};
});

9
vitest.config.js Normal file
View File

@ -0,0 +1,9 @@
import vue from '@vitejs/plugin-vue';
export default {
plugins: [vue()],
test: {
globals: true,
environment: 'jsdom',
},
}