Skip to content

Commit

Permalink
feat: 增加layouts
Browse files Browse the repository at this point in the history
  • Loading branch information
Saltro committed Apr 15, 2023
1 parent e35c34c commit cb81acc
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 44 deletions.
4 changes: 3 additions & 1 deletion app.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<template>
<div class="container">
<NuxtPage />
<nuxt-layout>
<nuxt-page />
</nuxt-layout>
</div>
</template>
<script setup lang="ts">
Expand Down
55 changes: 55 additions & 0 deletions layouts/default.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
<template>
<div class="container">
<slot />
</div>
</template>
<style scoped lang="less">
.container {
padding: 0 40px;
box-sizing: border-box;
}
.container /deep/ input {
width: 100%;
display: block;
box-sizing: border-box;
padding: 12px 0 12px 42px;
border: none;
border-radius: var(--border-radius-m);
font-size: 15px;
background-color: var(--color-input-bg);
}
.container /deep/ label {
width: 100%;
display: block;
box-sizing: border-box;
font-size: 13px;
margin-bottom: 4px;
font-weight: bold;
}
.container /deep/ button {
margin-top: 38px;
width: 100%;
border: none;
border-radius: var(--border-radius-m);
background-color: var(--color-primary);
font-size: 18px;
padding: 8px 0;
color: #FFFFFF;
}
.container /deep/ strong {
color: var(--color-primary);
}
.container /deep/ a {
text-decoration: none;
color: var(--color-primary);
}
.container /deep/ h1 {
font-size: 28px;
}
</style>
45 changes: 2 additions & 43 deletions pages/login.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@
<div class="form-item">
<div class="label-container">
<label>密码</label>
<a href="find"><strong>忘记密码?</strong></a>
<nuxt-link to="find"><strong>忘记密码?</strong></nuxt-link>
</div>
<input v-model="password" type="password" placeholder="请输入密码" />
</div>
<button>登录</button>
</form>
<p class="action">还没有账号?<a href="/register"><strong>立即注册</strong></a></p>
<p class="action">还没有账号?<nuxt-link to="/register"><strong>立即注册</strong></nuxt-link></p>
</div>
</template>
<script lang="ts" setup>
Expand Down Expand Up @@ -47,37 +47,7 @@ function submit(e: Event) {
}
}
strong,
a {
color: var(--color-primary);
}
a {
text-decoration: none;
}
.form-item {
label,
input {
width: 100%;
display: block;
box-sizing: border-box;
}
label {
font-size: 13px;
margin-bottom: 4px;
font-weight: bold;
}
input {
padding: 12px 0 12px 42px;
border: none;
border-radius: var(--border-radius-m);
font-size: 15px;
background-color: var(--color-input-bg);
}
.label-container {
display: flex;
align-items: center;
Expand All @@ -93,17 +63,6 @@ form {
gap: 12px;
}
button {
margin-top: 38px;
width: 100%;
border: none;
border-radius: var(--border-radius-m);
background-color: var(--color-primary);
font-size: 18px;
padding: 8px 0;
color: #FFFFFF;
}
.action {
width: 100%;
text-align: center;
Expand Down

0 comments on commit cb81acc

Please sign in to comment.