# FrontEnd Structure (NuxtJS)

# Folder structure

  • It's the same as Nuxt, because all files will be copied and forcebly pasted in the main folder during build time.
  • The main Js file of each module should have the same name as the module, to do not be overriden.

# Class structure

  • The module is a Js file that has a class that should extends the ModuleBase Class.
  • Except the must implement attributes and methods
Attributes Utility
name The Module name
cartTypes The cart items types that this Module will handle, each type should have one Module to handle
Methods Required Utility
init(context, app) To init the Module (Will always be running even if the module is not loaded)
drawerItemsBuild(items, context) To Inject items inside the Admin Drawer, ModuleBase.insertAfter(items, "KEY", object) and , ModuleBase.insertInsideAfter(items, "ITEM_KEY", "KEY", object)
incrementLoadingSize() Have to return the loading size needed by the module during socket load
loadSocket(socketOn, context) Used to load the socket's data, and increment the loading counter by context.store.dispatch("auth/incrementLoadingCount", 1);