From 5bd046abd8fdab4f6f49564e8ce2f6e4c22d859c Mon Sep 17 00:00:00 2001 From: Yuqi Feng Date: Thu, 25 Aug 2022 14:05:52 +0000 Subject: First release --- plugins/hxfetch.ts | 29 +++++++++++++++++++++++++++++ plugins/vuetify.ts | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 61 insertions(+) create mode 100755 plugins/hxfetch.ts create mode 100755 plugins/vuetify.ts (limited to 'plugins') diff --git a/plugins/hxfetch.ts b/plugins/hxfetch.ts new file mode 100755 index 0000000..c5d85f7 --- /dev/null +++ b/plugins/hxfetch.ts @@ -0,0 +1,29 @@ +// Author: Haoxiang Zhao + +import { defineNuxtPlugin } from "nuxt/app"; + +let baseurl: string = "/"; + +let hxfetch: object = { + get: (url: string, payload: object | any) => { + let payloadobject = new URLSearchParams(payload); + let params: string = payloadobject.toString(); + return fetch(baseurl.concat(url).concat("?").concat(params), { + method: "GET", + }); + }, + post: (url: string, payload: object) => { + return fetch(baseurl.concat(url), { + method: "POST", + body: JSON.stringify(payload), + }); + }, +}; + +export default defineNuxtPlugin(() => { + return { + provide: { + hxfetch: hxfetch, + }, + }; +}); diff --git a/plugins/vuetify.ts b/plugins/vuetify.ts new file mode 100755 index 0000000..7fc71d8 --- /dev/null +++ b/plugins/vuetify.ts @@ -0,0 +1,32 @@ +// Author: Haoxiang Zhao + +import { defineNuxtPlugin } from "nuxt/app"; +import { createVuetify } from "vuetify"; +import * as components from "vuetify/components"; +import * as directives from "vuetify/directives"; +import colors from "vuetify/lib/util/colors.mjs"; + +export default defineNuxtPlugin((nuxtApp) => { + const vuetify = createVuetify({ + components, + directives, + theme: { + defaultTheme: "hxlight", + themes: { + hxlight: { + dark: false, + colors: { + primary: colors.green.darken2, + }, + }, + hxdark: { + dark: true, + colors: { + primary: colors.green.darken2, + }, + }, + }, + }, + }); + nuxtApp.vueApp.use(vuetify); +}); -- cgit v1.2.3