Displays
Displays are Vue components for formatting some input data from a value
prop.
Display component
Display component is a proxy component which passes all its props down to a specified display type component.
Usage: <display type="String" value="value"></display>
.
Value will be just printed as-is if display type can not be resolved.
Available display types
Display types available out-of-the-box are described here. See custom display types section if you want to add a custom type.
All display types support a value
prop. Type-specific props definitions are provided in their descriptions.
array
Aliases: collection
Accepts array of values. Outputs configured display of each value.
Supported props:
itemProps
- array item display props ({ type: 'text' }
by default)
checkbox
Aliases: bool, boolean
Formats a boolean
or null
value with Font Awesome icon, text and color.
Value variants can be checked
, unchecked
and unknown
for true
, false
and null
respectively.
Supported props:
icon
- Font Awesome icon class for each value variant, default is{ checked: 'fas fa-check', uncheked: 'fas fa-times', unknown: 'fas fa-question-circle' }
text
- same for text, no text by defaultcolor
- same for color, can be any Bootstrap color mode fortext-*
class (primary
,info
,danger
, etc.), default is{ checked: 'primary', unknown: 'muted' }
color
I bet you can guess what it is :)
Accepts a hex color code without leading #
as a value.
date
Displays a date in a localized format.
Accepts Y-m-d
format as a value.
datetime
Displays date and time in a local format.
Accepts Y-m-d H:i:s
format as a value.
file
Displays a file download button.
Accepts file URL as a value.
float
Displays formatted floating point value.
Aliases: real, double, decimal
Supported props:
precision
- number of digits after the point
gallery
Displays thumbnails for an array of images.
html
Raw html value.
image
Image thumbnail.
json
Displays value as a preformatted JSON
key-value
Aliases: meta
Displays a provided object as a key-value pairs in a table.
relation
Displays entity item relation(s) with or without related item editing link.
Supported props:
display
-function(item)
or a string with placeholders generating a display name for related itementity
- related entity name, can be omitted for no-link relationcolor
- Bootstrap color mode (primary
,info
,danger
, etc.) for entity item button (with link) or label (without link), default isdefault
noLink
- disable link, but it will disabled anyway if noentity
provided or entity editing is not allowed
time
No comments here.