-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨feat: converte páginas em views do SPA | Parte 03
- Cria a "HomeView" a Partir de Trechos do HTML da Página "Index" - Prepara a Página "Index" para Ser o Ponto de Carregamento Único do SPA - Configura a "HomeView" nas Rotas e Na Barra de Navegação - Converte a Página "Contato" em "ContatoView" - Configura a "ContatoView" nas Rotas e Na Barra de Navegação - Convertendo a Página "Sobre" em "SobreView" - Configura a "SobreView" nas Rotas e Na Barra de Navegação - Implementa a "NotFoundView" e Configura nas Rotas
- Loading branch information
1 parent
e695b03
commit 3f66da4
Showing
13 changed files
with
325 additions
and
286 deletions.
There are no files selected for viewing
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,5 @@ | ||
{ | ||
"liveServer.settings.port": 5400, | ||
"liveServer.settings.file": "index.html", | ||
"liveServer.settings.root":"/", | ||
} |
This file was deleted.
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
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,4 +1,24 @@ | ||
import { HomeView } from "../views/home/home.js"; | ||
import { ContatoView } from "../views/contato/contato.js"; | ||
import { SobreView } from "../views/sobre/sobre.js"; | ||
import { NotFoundView } from "../views/not-found/not-found.js"; | ||
|
||
//Recupera o elemento HTML que vai armazenar os templates das views | ||
const containerView = document.getElementById('content-view'); | ||
|
||
//Instancia as Views | ||
const homeView = new HomeView(containerView); | ||
const contatoView = new ContatoView(containerView); | ||
const sobreView = new SobreView(containerView); | ||
const notFoundView = new NotFoundView(containerView); | ||
|
||
//Define um objeto para relacionar as rotas (URL) as views | ||
const routes = {}; | ||
const routes = { | ||
'/': homeView, | ||
'/home': homeView, | ||
'/contato': contatoView, | ||
'/sobre': sobreView, | ||
'/not-found': notFoundView, | ||
}; | ||
|
||
export { routes } |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.