HomeWiki
HomeWiki
  1. Components
  • Back to home
  • 1. Themes
  • Layout
    • New Layout
    • Legacy Layout
  • Components
    • Announcement
    • Banner Carousel
    • Banner With Products Carousel
    • Blog Category List
    • Blog List
    • Brand List
    • Brands Carousel
    • Breadcrumb
    • Call To Action
    • Cart
    • Categories List
    • Change Password
    • Checkout
    • Cookie Manager
    • Filter list
    • Footer
    • Forgot Password
    • Form
    • Hero Carousel
    • Icon Block
    • Invitation
    • Last Visited Products
    • Layout
    • Login
    • Map
    • Nav Bar
    • Offer
    • Product Attachments
    • Product Attributes
    • Product Documentation
    • Product Expected
    • Product Modal
    • Products Block
    • Products Carousel
    • Product Single
    • Profile
    • Quote
    • Register
    • Related Products
    • Search
    • Stores
    • Subscribe Newsletter
    • Text with Image
    • Top Bar
    • Video
  • Reusables
    • Getting Started
  • Assets
    • Getting Started
  • SDK
    • Products
      • _findProductsByCategory
      • _findProductsByIds
      • _findProductsByTitle
      • _findProductsByFilter
      • _findProductsByCriteria
      • _findProductsAndCalculate
      • _findProductsThenCalculate
      • _getProductAttributeSet
      • _setLastVisited
    • Categories
      • _findCategoryTreeById
      • _findCategoriesByIds
      • _findCategoryByAlias
      • _findCategoryTreeByAlias
      • _getCategoryContent
    • Collections
      • _getCollectionContent
      • _findCollectionsByIds
      • _findCollectionsByIdsThenCalculate
    • Brands
      • _getBrandContent
      • _findBrandsByIds
    • Cart
      • _addToCartMulti
      • _addToCart
      • _setCart
      • _clearCart
      • _setCartListener
      • _removeFromCart
      • _calculateCart
    • Checkout
      • _startCheckout
      • _updateCheckout
      • _completeCheckout
    • Shopping Lists
      • _getShoppingLists
      • _updateShoppingList
      • _createShoppingList
      • _deleteShoppingList
      • _getShoppingListByAlias
    • Navigation
      • _getFooterMenu
      • _getHeaderMenu
    • Users
      • _getUserById
    • Utils
      • _calculateCurrency
      • _getCurrencySymbol
      • _getCulture
      • _subscribeToNewsletter
      • _findUnitsByIds
  • Vs Code
    • Getting Started
  1. Components

Forgot Password

Documentation: Forgot Password Component#

The Forgot Password Component is designed for users to request a password reset. It guides users through a process to enter their email address and receive a temporary link for resetting their password. This component includes validation for email input and provides feedback based on the form submission outcome.

Overview#

The Forgot Password Component provides a user interface for requesting a password reset. It includes instructions, an email input field with validation feedback, and a submit button. The component is built using Vue.js and interacts with an API endpoint to handle password reset requests.

Model Documentation#

The model object is used to configure various aspects of the Forgot Password Component, including text translations and CSS classes.
Model Structure#
id: String
A unique identifier for the component, used as the id attribute in the HTML.
cssClass: String
Optional CSS class(es) for additional styling of the component.
Example Model#
{
  "id": "forgot-password",
  "cssClass": "forgot-password-form",
}

Component Structure#

The component consists of the following sections:
1.
Instructions and Steps: Provides guidance on the password reset process.
2.
Email Input Form: Allows users to input their email address and submit the form.
3.
Validation Feedback: Displays error messages based on the email validation and API response.

HTML Template#

The HTML template for the component is as follows:

JavaScript#

The JavaScript part of the component manages form submission and validation:

Explanation#

1.
Props:
model: The component receives a model object as a prop, which includes configuration data and text translations.
2.
Data:
model: Stores the model object.
email: Holds the email address entered by the user.
emailError: Indicates the type of error for email validation.
isloading: Shows or hides the loading spinner during form submission.
3.
Mounted Lifecycle Hook:
mounted(): Placeholder for any initialization needed when the component is mounted.
4.
Methods:
checkForm(e): Validates the email input and handles form submission. Displays appropriate error messages based on validation results and API responses.
5.
Computed Properties:
Not used in this component but can be added if needed for dynamic data.
6.
Watchers:
Not used in this component but can be added if needed for monitoring data changes.

Usage#

To use the Forgot Password Component:
1.
Define the Vue Component:
Use Vue.component() or app.component() to register the component.
2.
Create the Template:
Define the HTML structure with Vue.js directives for dynamic rendering.
3.
Implement JavaScript Logic:
Define props for the model object.
Initialize data and implement methods for form validation and API interaction.
Handle form submission and error messages based on user input and server responses.
4.
Customize Styling and Layout:
Apply CSS classes and styles to fit your design needs.
5.
Test and Debug:
Ensure the component functions correctly with various inputs and scenarios.
Debug any issues related to form validation or API responses.
6.
Deploy the Component:
Integrate the component into your Vue.js application and deploy it as part of your project.
This documentation provides a comprehensive guide to implementing and using the Forgot Password Component, including model requirements, component structure, and example usage.
Previous
Footer
Next
Form
Built with