-
-
Notifications
You must be signed in to change notification settings - Fork 178
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use Vue Router to get started on different screens
- Loading branch information
1 parent
f6c5192
commit e171927
Showing
8 changed files
with
103 additions
and
11 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,6 +20,7 @@ | |
}, | ||
"dependencies": { | ||
"axios": "^0.26.0", | ||
"vue-color": "^2.7.0" | ||
"vue-color": "^2.7.0", | ||
"vue-router": "3" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,32 @@ | ||
import Vue from 'vue'; | ||
import VueRouter from 'vue-router'; | ||
|
||
import App from './components/App.vue'; | ||
|
||
const app = new Vue({ | ||
import Login from './screens/Login.vue'; | ||
import Register from './screens/Register.vue'; | ||
|
||
Vue.use(VueRouter); | ||
|
||
const routes = [ | ||
{ | ||
path: '/prototype/login', | ||
name: 'login', | ||
component: Login, | ||
}, { | ||
path: '/prototype/register', | ||
name: 'register', | ||
component: Register, | ||
}, | ||
]; | ||
|
||
const router = new VueRouter({ | ||
mode: 'history', | ||
routes, | ||
}); | ||
|
||
new Vue({ | ||
el: '#app', | ||
render: h => h(App) | ||
}) | ||
router, | ||
render: h => h(App), | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,7 @@ | ||
<script setup> | ||
// | ||
</script> | ||
|
||
<template> | ||
<div> | ||
<div>Hello world</div> | ||
</div> | ||
<router-view></router-view> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<script setup> | ||
// | ||
</script> | ||
|
||
<template> | ||
<div class="max-w-sm mx-auto my-12"> | ||
<div class="p-5 bg-white border rounded-md space-y-5"> | ||
<div> | ||
<label class="block mb-1 text-sm text-gray-700">E-mail</label> | ||
<input class="w-full px-3 py-2 text-sm border rounded-md" type="email" /> | ||
</div> | ||
<div> | ||
<label class="block mb-1 text-sm text-gray-700">Password</label> | ||
<input class="w-full px-3 py-2 text-sm border rounded-md" type="password" /> | ||
</div> | ||
<button class="w-full py-2.5 hover:bg-blue-600 transition text-sm bg-blue-500 text-white rounded-md">Log in</button> | ||
</div> | ||
<div class="mt-4 text-center"> | ||
<router-link class="text-sm" :to="{ name: 'register' }">First time here? Register.</router-link> | ||
</div> | ||
</div> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<script setup> | ||
// | ||
</script> | ||
|
||
<template> | ||
<div class="max-w-sm mx-auto my-12"> | ||
<div class="p-5 bg-white border rounded-md space-y-5"> | ||
<div> | ||
<label class="block mb-1 text-sm text-gray-700">Name</label> | ||
<input class="w-full px-3 py-2 text-sm border rounded-md" type="text" /> | ||
</div> | ||
<div> | ||
<label class="block mb-1 text-sm text-gray-700">E-mail</label> | ||
<input class="w-full px-3 py-2 text-sm border rounded-md" type="email" /> | ||
</div> | ||
<div> | ||
<label class="block mb-1 text-sm text-gray-700">Password</label> | ||
<input class="w-full px-3 py-2 text-sm border rounded-md" type="password" /> | ||
</div> | ||
<div> | ||
<label class="block mb-1 text-sm text-gray-700">Verify password</label> | ||
<input class="w-full px-3 py-2 text-sm border rounded-md" type="password" /> | ||
</div> | ||
<div> | ||
<label class="block mb-1 text-sm text-gray-700">Currency</label> | ||
<input class="w-full px-3 py-2 text-sm border rounded-md" type="text" /> | ||
</div> | ||
<button class="w-full py-2.5 hover:bg-blue-600 transition text-sm bg-blue-500 text-white rounded-md">Register</button> | ||
</div> | ||
<div class="mt-4 text-center"> | ||
<router-link class="text-sm" :to="{ name: 'login' }">Already using Budget? Log in.</router-link> | ||
</div> | ||
</div> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters