瀏覽代碼

admin-2025-02-17 02:10:44

genlitex 2 月之前
父節點
當前提交
6118026913

+ 5 - 0
components.d.ts

@@ -7,6 +7,11 @@ export {}
 /* prettier-ignore */
 declare module 'vue' {
   export interface GlobalComponents {
+    AButton: typeof import('ant-design-vue/es')['Button']
+    AForm: typeof import('ant-design-vue/es')['Form']
+    AFormItem: typeof import('ant-design-vue/es')['FormItem']
+    AInput: typeof import('ant-design-vue/es')['Input']
+    AInputPassword: typeof import('ant-design-vue/es')['InputPassword']
     RouterLink: typeof import('vue-router')['RouterLink']
     RouterView: typeof import('vue-router')['RouterView']
   }

文件差異過大導致無法顯示
+ 0 - 4
dist/assets/index-CLQU_RzH.js


文件差異過大導致無法顯示
+ 4 - 0
dist/assets/index-ZDXgRNyb.js


文件差異過大導致無法顯示
+ 0 - 0
dist/assets/index-oJPMG4fY.css


+ 2 - 2
dist/index.html

@@ -4,8 +4,8 @@
     <meta charset="UTF-8" />
     <meta name="viewport" content="width=device-width, initial-scale=1.0" />
     <title>Prototype Design</title>
-    <script type="module" crossorigin src="/ide/proxy/6009/assets/index-CLQU_RzH.js"></script>
-    <link rel="stylesheet" crossorigin href="/ide/proxy/6009/assets/index-BtM_Gz6j.css">
+    <script type="module" crossorigin src="/ide/proxy/6004/assets/index-ZDXgRNyb.js"></script>
+    <link rel="stylesheet" crossorigin href="/ide/proxy/6004/assets/index-oJPMG4fY.css">
   </head>
   <body>
     <div id="app"></div>

+ 6 - 0
src/router/index.js

@@ -1,11 +1,17 @@
 import { createRouter, createWebHashHistory } from 'vue-router'
 import HomeView from '../views/HomeView.vue'
+import LoginView from '../views/LoginView.vue'
 
 const routes = [
   {
     path: '/',
     name: 'home',
     component: HomeView
+  },
+  {
+    path: '/login',
+    name: 'login',
+    component: LoginView
   }
 ]
 

+ 16 - 2
src/views/HomeView.vue

@@ -1,13 +1,20 @@
 <template>
   <div class="home">
     <h2>欢迎使用Prototype Design, 请您根据您的需要设计您的Prototype</h2>
+    <a-button type="primary" @click="goToLogin" class="center-button">Go To Login</a-button>
   </div>
 </template>
 
-<script>
+<script setup>
+import { useRouter } from 'vue-router';
 
-export default {}
+const router = useRouter();
+
+function goToLogin() {
+  router.push({ name: 'login' });
+}
 </script>
+
 <style>
 .home {
   height: 100vh;
@@ -15,5 +22,12 @@ export default {}
   display: flex;
   justify-content: center;
   align-items: center;
+  flex-direction: column;
+}
+
+.center-button {
+  margin-top: 20px;
 }
 </style>
+
+

+ 39 - 0
src/views/LoginView.vue

@@ -0,0 +1,39 @@
+<template>
+  <div class="login">
+    <a-form :model="formState" @submit="handleSubmit">
+      <a-form-item label="Username" field="username">
+        <a-input v-model="formState.username" placeholder="Enter your username" />
+      </a-form-item>
+      <a-form-item label="Password" field="password">
+        <a-input-password v-model="formState.password" placeholder="Enter your password" />
+      </a-form-item>
+      <a-form-item>
+        <a-button type="primary" html-type="submit">Submit</a-button>
+      </a-form-item>
+    </a-form>
+  </div>
+</template>
+
+<script setup>
+import { reactive } from 'vue';
+
+const formState = reactive({
+  username: '',
+  password: ''
+});
+
+function handleSubmit(e) {
+  e.preventDefault();
+  console.log(formState);
+}
+</script>
+
+<style>
+.login {
+  height: 100vh;
+  width: 100vw;
+  display: flex;
+  justify-content: center;
+  align-items: center;
+}
+</style>

部分文件因文件數量過多而無法顯示