first
This commit is contained in:
38
safekiso_admin/base/plugins/!.ts
Normal file
38
safekiso_admin/base/plugins/!.ts
Normal file
@@ -0,0 +1,38 @@
|
||||
export default defineNuxtPlugin((nuxtApp) => {
|
||||
// _utils.log('defineNuxtPlugin() of !.ts executed...');
|
||||
_crossCtl.setConfig(useRuntimeConfig().public);
|
||||
|
||||
/*
|
||||
nuxtApp.hook('app:created', () => {
|
||||
_utils.log('nuxtApp.hook, app:created');
|
||||
});
|
||||
nuxtApp.hook('app:beforeMount', () => {
|
||||
_utils.log('nuxtApp.hook, app:beforeMount');
|
||||
});
|
||||
nuxtApp.hook('app:mounted', () => {
|
||||
_utils.log('nuxtApp.hook, app:mounted');
|
||||
});
|
||||
|
||||
|
||||
nuxtApp.hook('vue:error', (..._args) => {
|
||||
console.log('vue:error');
|
||||
// if (process.client) {
|
||||
// console.log(..._args)
|
||||
// }
|
||||
});
|
||||
nuxtApp.hook('app:error', (..._args) => {
|
||||
console.log('app:error');
|
||||
// if (process.client) {
|
||||
// console.log(..._args)
|
||||
// }
|
||||
});
|
||||
|
||||
nuxtApp.vueApp.config.errorHandler = (..._args) => {
|
||||
console.log('global error handler');
|
||||
// if (process.client) {
|
||||
// console.log(..._args);
|
||||
// }
|
||||
return true;
|
||||
};
|
||||
*/
|
||||
});
|
||||
44
safekiso_admin/base/plugins/customDateTimeFormat.ts
Normal file
44
safekiso_admin/base/plugins/customDateTimeFormat.ts
Normal file
@@ -0,0 +1,44 @@
|
||||
export default defineNuxtPlugin((/* nuxtApp */) => {
|
||||
// _utils.log('defineNuxtPlugin() of customDateTimeFormat.ts executed...');
|
||||
return {
|
||||
provide: {
|
||||
customFormat: (rawtime) => {
|
||||
const date: any = new Date(rawtime);
|
||||
const year = date.getFullYear();
|
||||
const month = date.getMonth() + 1;
|
||||
const day = date.getDate();
|
||||
let hh = date.getHours();
|
||||
const mm = date.getMinutes();
|
||||
|
||||
const AmOrPm = hh <= 12 ? '오전' : '오후';
|
||||
hh = hh % 12 || 12;
|
||||
|
||||
const diffInSec = Math.floor((Date.now() - date) / 1000);
|
||||
if (diffInSec < 30) {
|
||||
return '조금 전';
|
||||
}
|
||||
if (diffInSec < 59) {
|
||||
return diffInSec + '초 전';
|
||||
}
|
||||
const diffInMin = Math.floor(diffInSec / 60);
|
||||
if (diffInMin < 59) {
|
||||
return diffInMin + '분 전';
|
||||
}
|
||||
return (
|
||||
year +
|
||||
'년 ' +
|
||||
month +
|
||||
'월' +
|
||||
' ' +
|
||||
day +
|
||||
'일, ' +
|
||||
AmOrPm +
|
||||
' ' +
|
||||
hh +
|
||||
':' +
|
||||
mm
|
||||
);
|
||||
},
|
||||
},
|
||||
};
|
||||
});
|
||||
17
safekiso_admin/base/plugins/dayjs.ts
Normal file
17
safekiso_admin/base/plugins/dayjs.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
import dayjs from 'dayjs';
|
||||
import relativeTime from 'dayjs/plugin/relativeTime.js';
|
||||
import 'dayjs/locale/ko';
|
||||
|
||||
dayjs.locale('ko');
|
||||
dayjs.extend(relativeTime);
|
||||
|
||||
export default defineNuxtPlugin((/* nuxtApp */) => {
|
||||
// _utils.log('defineNuxtPlugin() of dayjs.ts executed...');
|
||||
return {
|
||||
provide: {
|
||||
dayjs: (rawDateTime) => {
|
||||
return dayjs(rawDateTime);
|
||||
},
|
||||
},
|
||||
};
|
||||
});
|
||||
9
safekiso_admin/base/plugins/quill.client.js
Normal file
9
safekiso_admin/base/plugins/quill.client.js
Normal file
@@ -0,0 +1,9 @@
|
||||
import { defineNuxtPlugin } from '#app';
|
||||
|
||||
import { QuillEditor } from '@vueup/vue-quill';
|
||||
|
||||
import '@vueup/vue-quill/dist/vue-quill.snow.css';
|
||||
|
||||
export default defineNuxtPlugin((nuxtApp) => {
|
||||
nuxtApp.vueApp.component('QuillEditor', QuillEditor);
|
||||
});
|
||||
10
safekiso_admin/base/plugins/vueGoogleMaps.ts
Normal file
10
safekiso_admin/base/plugins/vueGoogleMaps.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
import VueGoogleMaps from '@fawmi/vue-google-maps';
|
||||
|
||||
export default defineNuxtPlugin((nuxtApp) => {
|
||||
const config = useRuntimeConfig().public;
|
||||
nuxtApp.vueApp.use(VueGoogleMaps, {
|
||||
load: {
|
||||
key: config.GOOGLE_MAPS_API_KEY,
|
||||
},
|
||||
});
|
||||
});
|
||||
12
safekiso_admin/base/plugins/vueJsonPretty.ts
Normal file
12
safekiso_admin/base/plugins/vueJsonPretty.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
import VueJsonPretty from 'vue-json-pretty';
|
||||
|
||||
export default defineNuxtPlugin((/* nuxtApp */) => {
|
||||
// _utils.log('defineNuxtPlugin() of dayjs.ts executed...');
|
||||
return {
|
||||
provide: {
|
||||
vueJsonPretty: () => {
|
||||
return new VueJsonPretty();
|
||||
},
|
||||
},
|
||||
};
|
||||
});
|
||||
Reference in New Issue
Block a user