Vue Bootstrap Dummy MDB Pro component
Vue Dummy - Bootstrap 4 & Material Design
The mdb-dummy
is a custom directive which loads placeholders
for images, tables, text & lists.
Import
Step 1: Import the directive from 'mdbvue'
Step 2: Add mdbDummy to the directives
object
Random text
To generate random text, attach the directive to the element which
innerText
attribute is to be edited and add
:text
modifier. The value indicated the number of characters in
the generated text.
Name | Type | Default | Description | Example |
---|---|---|---|---|
value
|
Number | 150 |
Specifies the length of the generated random text |
<p v-mdb-dummy:text="300" ></p>
|
Image placeholder
To generate an image placeholder in the given size, attach the directive to
an img
tag (the directive will also work if it's attached to a
wrapper containing img
elements - bear in mind that in this
case, it will affect all of the nested images) and add
:img
modifier. The value will indicate the size of a
placeholder - there are two data types supported: number
and
object
(with width
and height
keys)
Name | Type | Default | Description | Example |
---|---|---|---|---|
value
|
Number, Object | 150 |
Specifies the size of an image placeholder |
<p v-mdb-dummy:img="300" ></p>
|
List
The directive attached to an ol
or ul
element will
append li
elements to it - the number depend on the value
passed to the directive.
Name | Type | Default | Description | Example |
---|---|---|---|---|
value
|
Number | 5 |
Number of list items |
<p v-mdb-dummy:list="3" ></p>
|
Table
You can generate a simple table with v-mdb-dummy
as well -
attach the directive to a table
element, add
:table
modifier and pass an object indicating a number of rows
and columns.
Name | Type | Default | Description | Example |
---|---|---|---|---|
value
|
Object | { rows: 10, columns: 5} |
Number of rows and columns |
<p v-mdb-dummy:table="{columns: 7, rows: 14}"
></p>
|