PHP Classes

File: assets/js/pages/contactPage.js

Recommend this page to a friend!
  Classes of Rodrigo Faustino   Simple SPA   assets/js/pages/contactPage.js   Download  
File: assets/js/pages/contactPage.js
Role: Auxiliary data
Content type: text/plain
Description: Auxiliary data
Class: Simple SPA
Demonstrates single page applications
Author: By
Last change:
Date: 17 days ago
Size: 1,129 bytes
 

Contents

Class file image Download
import Component from '../component/Component.js'; import FormContact from '../form/FormContact.js'; class ContactPage extends Component { constructor() { super(); this.title = 'Contato - Meu SPA'; this.description = 'Entre em contato conosco através desta página.'; this.keywords = 'contato,email,telefone,endereço'; } render() { const handleSubmit = (event) => { event.preventDefault(); const formData = new FormData(event.target); const data = {}; formData.forEach((value, key) => { data[key] = value; }); console.log('Dados do Formulário:', data); }; const formComponent = new FormContact(handleSubmit); return ` <div class="w3-center"> <div class="contact-page"> <h1>Contato</h1> ${formComponent.render()} </div> </div> `; } afterRender() { const formComponent = new FormContact(); formComponent.afterRender(); } } export default ContactPage;