- Introduced WithdrawMethodEnum and ChainEnum in enum.ts for withdrawal methods and blockchain types. - Updated types.ts to include WithdrawBody type for withdrawal requests. - Created a new useResetRef composable for managing form state resets. - Added a withdraw page with form handling in index.vue, including validation and submission logic. - Integrated the new withdraw functionality into the wallet card component. - Updated the main.ts file to include Pinia for state management. - Created a wallet store to manage user balances. - Modified the deposit page to improve user experience and validation. - Added number pattern validation for input fields. - Updated the router to include a new route for the withdraw page. - Refactored input-label component styles for better layout. - Added a new rules.ts file for future validation rules.
56 lines
1.4 KiB
TypeScript
56 lines
1.4 KiB
TypeScript
import path from "node:path";
|
|
import ui from "@nuxt/ui/vite";
|
|
import legacy from "@vitejs/plugin-legacy";
|
|
import vue from "@vitejs/plugin-vue";
|
|
import jsx from "@vitejs/plugin-vue-jsx";
|
|
import dotenv from "dotenv";
|
|
import UnoCSS from "unocss/vite";
|
|
import autoImport from "unplugin-auto-import/vite";
|
|
import iconsResolver from "unplugin-icons/resolver";
|
|
import icons from "unplugin-icons/vite";
|
|
import { IonicResolver } from "unplugin-vue-components/resolvers";
|
|
import components from "unplugin-vue-components/vite";
|
|
import { defineConfig } from "vite";
|
|
|
|
const env = dotenv.config({ path: `.env` }).parsed as Record<string, string>;
|
|
|
|
console.log("🚀 ~ file: vite.config.ts ~ env:", env);
|
|
|
|
// https://vitejs.dev/config/
|
|
export default defineConfig({
|
|
plugins: [
|
|
vue(),
|
|
jsx(),
|
|
legacy(),
|
|
autoImport({
|
|
dirs: ["src/composables", "src/utils", "src/store"],
|
|
imports: ["vue", "vue-router", "@vueuse/core", "vue-i18n"],
|
|
resolvers: [IonicResolver()],
|
|
vueTemplate: true,
|
|
}),
|
|
components({
|
|
directoryAsNamespace: true,
|
|
resolvers: [IonicResolver(), iconsResolver({ prefix: "i" })],
|
|
}),
|
|
icons({
|
|
autoInstall: true,
|
|
}),
|
|
UnoCSS(),
|
|
ui(),
|
|
],
|
|
resolve: {
|
|
alias: {
|
|
"@": path.resolve(__dirname, "./src"),
|
|
},
|
|
},
|
|
server: {
|
|
host: true,
|
|
proxy: {
|
|
"/api": {
|
|
target: env.VITE_API_URL,
|
|
changeOrigin: true,
|
|
},
|
|
},
|
|
},
|
|
});
|