Why use Components?¶
Components improve web development by increasing efficiency and maintainability. They allow for separation of concerns, easier reuse and testing, and promote modular design. Using components results in a more organised, consistent and efficient codebase.
Props and Emits¶
Properties (props
) are data that is passed from the parent to a child component, while events (emits
) are data that are passed from a child component to its parent.
Button¶
What is it?
Allows all our buttons to have a consistent style across all pages.
Props:
buttonText
buttonColor
Default: primarysize
Default: largetextColor
Default: text-blackloading
Default: false
How to use it?
1 2 3 4 5 6 7 8 |
|
A function that handles the click event
1 |
|
Chip¶
What is it?
The chip component is utilized within the multi-select component as a compact representation of selected items, featuring an icon for communicating with the parent component when pressed.
Props:
text
bgColor
Default: bg-goldtextColor
Default: text-blacksize
Small, Medium - Default, Large
Emits:
removeChip
Parameters: Chip Text
How to use it?
1 |
|
When the icon on the chip component is clicked, it will pass the text that is displayed on the chip
1 |
|
Multi Select¶
What is it?
The component displays a list of items and allows multi-selection, returning the chosen items to the parent.
Props:
items
Default: [ "Novice", "Junior", "Senior" ]placeholder
Default: Select levelsselectedChips
Emits:
change
Parameters: Array of Chip text
How to use it?
1 2 3 4 5 |
|
This function displays a list of selected items
1 |
|
Search Select¶
What is it? The component displays a list of items and allows you to search for an items and return it to the parent after selection.
Props:
items
placeholder
Default: School Namelabel
Default: School NamemodelValue
Emits:
info
Parameter: The clicked list itemupdate:modelValue
Parameter: The typed input
How to use it?
1 2 3 4 5 6 7 |
|
1 2 3 4 5 |
|
Dropdown¶
What is it?
Similiar to the default HTML select element, however styled to match the MultiSelect
and SearchSelect
Props:
items
Default: [ "Team Coordinator" ]placeholder
Default: Select Rolelabel
Default: Team CoordinatormodelValue
color
disabled
Default: false
Emits:
change
update:modelValue
Parameter: The clicked item
How to use it?
1 2 3 4 5 6 7 8 |
|
1 |
|
Table¶
What is it?
Renders a table based on the header and data passed. A slot can be used for custom columns.
Props:
headers
data
canEdit
noDataText
default: No teams registered
Emits:
edit
Parameters: editMode, modalVisibility, data
How to use it?
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
|
No custom columns required:
1 2 3 4 5 6 7 |
|
Require custom columns:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
|
Search Bar¶
What is it?
The search bar filters the data in a table based on a search term entered into the text input.
Emits:
handleFilter
Parameter: The inputted text
How to use it?
1 |
|
This function should update the data that passed into the table component
1 |
|
Tabs¶
What is it?
When a tab is clicked it passes the label to the parent so that the relevant information can be displayed.
Props:
tabs
fontSize
Emits:
handleTab
Parameter: Tab label
How to use it?
1 |
|
Setup tab labels and default active state
1 2 3 4 5 |
|
A function that is used to get the tab thats been clicked
1 |
|
Notifications¶
What is it? A small popup that display information on a successful or unsuccessful request.
Props:
modalVisibility
Default falseheader
body
Default New tournament successfully createdisSuccess
Default false
Emits:
close
How to use it?
1 |
|
1 2 3 4 5 6 |
|
Form Field¶
What is it?
Props:
label
modelValue
placeholder
type
Default: textdisabled
Default: falsecolor
Emits:
update:modelValue
Parameter: Inputted text
How to use it?
1 2 3 4 5 6 |
|
1 |
|
Header¶
What is it?
Text that is used to describe the current page
Props:
titleText
hasLine
Default: true
How to use it?
1 |
|
Modal¶
What is it? A modal is a small popup window that displays content on top of the main interface.
Props:
modalVisibility
Default: falsesize
Default: w-7/12
Emits:
close
How to use it?
1 2 3 4 5 6 7 8 9 10 11 |
|
1 |
|
Delete Dialog¶
What is it? This Delete Dialog builds upon the modal component, it asks for confirmation before deleting an entry. Its purpose is to prevent accidental deletions. Emits:
yes
no
close
How to use it?
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
|
1 2 3 4 |
|
Loading¶
What is it?
An SVG that is a animated
How to use it?
1 |
|
Admin Button¶
What is it?
A button that includes an icon that are used on the admin dashboard for page navigation
Props:
title
link
icon
How to use it?
1 2 3 4 5 |
|
Admin Profile Information¶
What is it?
Displays the logged in users full name and role
Props:
username
role
How to use it?
1 |
|
Home Page Level Button¶
What is it?
A button that display the name of the tournament
Props:
text
Default: tournament
How to use it?
1 |
|
Navigation Bar and Home Button¶
What are they?
The home button displays the WADL logo on the navigation bar
How to use it?
1 |
|