๋ก๊ทธ์ธ ํ์ด์ง๋ ๊ฐ์ ํ๊ธฐ ํ์ด์ง๋ฅผ ๊ทธ๋๋ก ๋ณต์ฌํ์ฌ ํ์ํ ๋ถ๋ถ๋ง ๋จ๊ฒจ๋๋๋ค.
<template>
<div class="flex flex-col items-center space-y-4 mt-10">
<i
:class="`fab fa-twitter text-4xl text-primary ${
loading ? 'animate-bounce' : ''
}`"
></i>
<span class="text-2xl font-bold">ํธ์๋ ๋ก๊ทธ์ธ</span>
<input
v-model="email"
type="email"
class="rounded w-96 px-4 py-3 border border-gray-200 focus:ring-2 focus:outline-none focus:border-primary"
placeholder="์ด๋ฉ์ผ"
/>
<input
v-model="password"
type="password"
class="rounded w-96 px-4 py-3 border border-gray-200 focus:ring-2 focus:outline-none focus:border-primary"
placeholder="๋น๋ฐ๋ฒํธ"
/>
<button
@click="onLogin"
class="w-96 rounded bg-primary text-white py-4 hover:bg-dark"
>
๋ก๊ทธ์ธ
</button>
<router-link to="/register">
<button class="text-primary">๊ณ์ ์ด ์์ผ์ ๊ฐ์? ํ์๊ฐ์
ํ๊ธฐ</button>
</router-link>
</div>
</template>
<script>
import { ref } from "vue";
export default {
setup() {
// ๋ณ์ ref(์ด๊ธฐ๊ฐ) usestate ์ ๋์ผ
const email = ref("");
const password = ref("");
const loading = ref(false);
//ํ์๊ฐ์
ํด๋ฆญ ์ ์คํ๋๋ ํจ์
const onLogin = () => {
console.log(email.value, password.value);
};
return {
email,
password,
loading,
onLogin,
};
},
};
</script>
<style></style>

<router-link to="/register">
<button class="text-primary">๊ณ์ ์ด ์์ผ์ ๊ฐ์? ํ์๊ฐ์
ํ๊ธฐ</button>
</router-link>
router-link๋ฅผ ํตํด ํด๋น ๋ฒํผ์ ํด๋ฆญํ๋ฉด ํ์๊ฐ์ ํ์ด์ง๋ก ์ด๋ํ๊ฒํ๋ค.
ํ์๊ฐ์ ํ์ด์ง์๋ ๋์ผํ๊ฒ ์ ์ฉํ๋ค.
<router-link to="/login">
<button class="text-primary">๊ณ์ ์ด ์ด๋ฏธ ์์ผ์ ๊ฐ์? ๋ก๊ทธ์ธํ๊ธฐ</button>
</router-link>