About
export default {
namespaced: true,
state: () => ({
name: 'Skye',
email: 'hkim7095@gmail.com',
blog: 'https://skye-coding.tistory.com/',
phone: '+82-1234-5678',
image: ''
})
}
store폴더 안에 about.js내용입니다. image 경로를 설정하면 됩니다.
<template>
<div class="about">
<div class="logo">
<Loader
v-if="imageLoading"
absolute />
<img :src="image" :alt="name">
</div>
<div class="name">{{ name }}</div>
<div>{{ email }}</div>
<div>{{ blog }}</div>
<div>{{ phone }}</div>
</div>
</template>
routes폴더 안에 About.vue의 template내용입니다.
loading 애니메이션을 추가할 생각입니다.
<script>
import Loader from '~/components/Loader';
export default {
components: {
Loader
},
data() {
return {
imageLoading: true
}
},
computed: {
image() {
return this.$store.state.about.image
},
name() {
return this.$store.state.about.name
},
email() {
return this.$store.state.about.email
},
blog() {
return this.$store.state.about.blog
},
phone() {
return this.$store.state.about.phone
}
},
mounted(){
this.init()
},
methods: {
async init() {
await this.$loadImage(this.image)
this.imageLoading = false
}
}
}
</script>
routes폴더 안에 About.vue의 script내용입니다.
<style lang="scss">
@import '~/scss/main';
.about {
text-align: center;
.logo {
width: 250px;
height: 250px;
margin: 40px auto 20px;
padding: 30px;
border: 10px solid $gray-300;
border-radius: 50%;
box-sizing: border-box;
background-color: $gray-200;
position: relative;
img {
width: 100%;
padding: 10px;
}
}
.name {
font-size: 40px;
font-family: 'Oswald', sans-serif;
margin-bottom: 20px;
}
}
</style>
routes폴더 안에 About.vue의 style내용입니다.
404 Page not found
routes폴더 안에 index.js에 NotFound를 import합니다.
<template>
<div class="not-found">
<div class="status">
404
</div>
<div class="message">
Page Not Found!
</div>
</div>
</template>
<style lang="scss" scoped>
@import '~/scss/main';
.not-found {
line-height: 1.2;
text-align: center;
font-family: 'Oswald', sans-serif;
padding: 80px 20px;
.status {
font-size: 160px;
color: $primary;
}
.message {
font-size: 50px;
}
}
</style>
routes폴더 안에 NotFound.vue를 만들고 위와 같이 작성하면 됩니다.
'배워서 따라하는 포플 > 영화 검색 사이트' 카테고리의 다른 글
검색 정보 초기화 및 스크롤 위치 복구 (0) | 2023.08.31 |
---|---|
부트스트랩 Breadkpoint, 전역 스타일 (0) | 2023.08.30 |
영화 포스트 로드 이벤트, 예외처리, Nav 경로 일치 및 활성화 (0) | 2023.08.28 |
단일 영화 상세 페이지 (0) | 2023.08.28 |
Container 사용자 지정, 에러 메시지 출력, 로딩 애니메이션, Footer (0) | 2023.08.28 |