chore: 添加环境变量配置,集成自动导入和组件插件,重构路由和组件
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
<script setup lang="ts">
|
||||
import { IonApp, IonRouterOutlet } from "@ionic/vue";
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
||||
31
src/auth/components/signup.vue
Normal file
31
src/auth/components/signup.vue
Normal file
@@ -0,0 +1,31 @@
|
||||
<script lang='ts' setup>
|
||||
import { modalController } from "@ionic/vue";
|
||||
|
||||
const name = ref();
|
||||
|
||||
const cancel = () => modalController.dismiss(null, "cancel");
|
||||
const confirm = () => modalController.dismiss(name.value, "confirm");
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<IonHeader>
|
||||
<IonToolbar>
|
||||
<IonButtons slot="start">
|
||||
<IonButton color="medium" @click="cancel">
|
||||
Cancel
|
||||
</IonButton>
|
||||
</IonButtons>
|
||||
<IonTitle>Modal</IonTitle>
|
||||
<IonButtons slot="end">
|
||||
<IonButton :strong="true" @click="confirm">
|
||||
Confirm
|
||||
</IonButton>
|
||||
</IonButtons>
|
||||
</IonToolbar>
|
||||
</IonHeader>
|
||||
<IonContent class="ion-padding">
|
||||
<IonItem>
|
||||
<IonInput v-model="name" label-placement="stacked" label="Enter your name" placeholder="Your name" />
|
||||
</IonItem>
|
||||
</IonContent>
|
||||
</template>
|
||||
@@ -1,5 +1,12 @@
|
||||
import { modalController } from "@ionic/vue";
|
||||
import { createAuthClient } from "better-auth/vue";
|
||||
|
||||
export const authClient = createAuthClient({
|
||||
baseURL: "http://192.168.1.36:9527", // The base URL of your auth server
|
||||
baseURL: import.meta.env.VITE_BASE_API_URL, // The base URL of your auth server
|
||||
});
|
||||
|
||||
export function signupController() {
|
||||
return modalController.create({
|
||||
component: () => import("./components/signup.vue"),
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
<script setup lang="ts">
|
||||
import { IonIcon, IonLabel, IonPage, IonRouterOutlet, IonTabBar, IonTabButton, IonTabs } from "@ionic/vue";
|
||||
import { ellipse, square, triangle } from "ionicons/icons";
|
||||
</script>
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { RouteRecordRaw } from "vue-router";
|
||||
import { createRouter, createWebHistory } from "@ionic/vue-router";
|
||||
import Layout from "@/components/layout/default.vue";
|
||||
import LayoutDefault from "@/components/layout/default.vue";
|
||||
|
||||
const routes: Array<RouteRecordRaw> = [
|
||||
{
|
||||
@@ -9,12 +9,9 @@ const routes: Array<RouteRecordRaw> = [
|
||||
},
|
||||
{
|
||||
path: "/layout/",
|
||||
component: Layout,
|
||||
component: LayoutDefault,
|
||||
redirect: "/layout/home",
|
||||
children: [
|
||||
{
|
||||
path: "",
|
||||
redirect: "/layout/home",
|
||||
},
|
||||
{
|
||||
path: "home",
|
||||
component: () => import("@/views/home/index.vue"),
|
||||
|
||||
Reference in New Issue
Block a user