PokeApp Made with Vue.js

Poke-App made with Vue.js

1. Development environment

Vue.js

2. Directory

src
├── api                              
├── components                         
    └── common 
├── router
├── views   
└── store   

3. Component composition

Main / poke list

list_component

scrap list

scrap_component

not found

notfoun_component

PokeSearch

Pokemon search component

function: search

NavBar

Menu component

function: page movement

PokeList

Pokemon list component

function: page load (Pokemon list, scrap list)

Poke

Pokemon-specific component

functions exposed to the Pokemon list : data exposure, scrap

PokeDetail

Pokemon detailed information component

function: data exposure

common/Modal

Validity check during search, Modal use for detailed information exposure

4. Page composition

  • list: Pokemon list exposure
  • scrap: expose scrap list
  • else: expose 404 not found page

5. localStorage

SHOW SCRAP LIST To reduce API communication, save id and name in localStorage

Classification value scraplist.id

Before modification

  • When loading the scrap list by storing only the id, api communication was attempted to expose only the scraped contents, but ex) a problem occurred in which api communication had to be performed several times for the Pokemon with id = 100

After modification

  • It is determined that there is no need for api communication for scrap because the values ​​fetched during list API communication are id and name. Save the id and name and extract the list from localstorage to avoid unnecessary API communication and expose the scrap contents in the order set by the user.

localStorage structure

localStorage

6. Function

1. page load

  • As the user scrolls, api communicates to bring up the list of the next page.
  • In case of scrap list, data is loaded from localStorage
  • In case of Pokemon list, data is loaded through external API communication
  • When clicking the Pokemon image, related Pokemon information is displayed in the Pokemon details modal window.
  • When loading the same scrap and Pokemon list, limit = 20 unified
  • => I tried to expose the background color for each type in the list, but it was determined that additional api communication for each Pokemon was unnecessary to extract only the type value, so the background color was exposed only in detailed information.

2. Search

  • When searching for numbers, related Pokemon information Pokemon details are exposed in the modal window
  • Exposing error contents in modal window as a result of validation
  • Whether to be empty, 0, or numeric

3. Pokemon details

  • Exposing detailed information in modal window
  • Exposure data
  • Image, name, ID, height, weight
  • Exposure of background color suitable for each type of Pokemon

4. Scrap

  • Heart-shaped scrap function exposed in Pokemon list
  • Scraped Pokemon: red
  • Unscraped Pokemon: black
  • Click Scrap <-> !Change Scrap

5. List

  • Poke List: Pokemon list exposure
  • Scrap List: Exposing scrap list

7. Results screen

Main screen and Pokemon list page screen

list

Scrap list page screen

scrap

404 not found page screen

not found

Pokemon detailed information result screen-Background color is exposed differently according to Pokemon type

PokeDetail

PokeDetail5 PokeDetail2 PokeDetail3 PokeDetail4

Validity check result screen when searching-Using modal window

error1

error2

error3

+) add

err

Download Details:

Author: jhyounyaho

Source Code: https://github.com/jhyounyaho/Vuejs-poke-api

#vue #vuejs #javascript

PokeApp Made with Vue.js
6.65 GEEK