The customizable dimmers come in two components and loading that can just bind a text comes as a directive.
The two components are really similar, one is dimmable
and surrounds the part to dimm down. The second is dimmer
and is inside the <div>
or other to dimm down. There are few nuances for ease and shortcuts.
<div>
<dimmer v-model="dimmed">
Hi!
</dimmer>
<content />
</div>
<dimmable v-model="dimmed" text="Hi!">
<content />
</dimmable>
<dimmable v-model="dimmed">
<h2 slot="dimmer">
Hi!
</h2>
<content />
</dimmable>
The model is visible: boolean
(event: change
) specifying whether the dimmer is active or not.
variation: 'simple'|'inverted'|''
on: string
duration: {show: number, hide:number}
transition: string
show
hide
change(visible: boolean)
The property page: boolean
allows the dimmer
not to dimm its container but the whole page.
Note that a dimmer dimms the element it is in, not the component.
The dimmable
' dimmer content can be given in the dimmer
slot. There is a predefined slot who displays these two properties:
icon: string
text: string
Also, this property:
blurring: boolean
Last but not least, the dimmer
slot of a dimmable is already surrounded by div.content div.center
, so it is less configurable but shorter as a shortcut.
The directive v-loading
allows to dimm an element and display a loading icon with a text on it.
<div v-loading.modifier1.modifier2="loadingValue">
loadingValue
is of course a component' data.
This data can take a falsy value to hide the loading-dimmer (for regular state) or be shown
- If it is a
string
, this will be the message displayed - If it is
true
, only the icon will be displayed
Some easy way to manage a boolean and use a string are:
<s-button @click="loading=!loading">Load ?</button>
<div v-loading="loading && 'Loading references...'">
...
<s-button @click="loading=!loading && 'Loading references...'">Load ?</button>
<div v-loading="loading">
...
blurring
indeterminate
inverted
- Size specification :
mini
,tiny
,small
,medium
,large
The directive v-dimm-parts
allow some parts of the element to be dimmed when the mouse is out of the element.
<s-input inline v-dimm-parts:minus.inverted>
<s-button slot="append" class="input-dimmed" icon="minus" dimmed-part="minus" />
</s-input>
Use a dimming-identifier if the element might contain other dimm-parts. All the sub-elements with the attribute dimmed-part
(or dimmed-part="identifier"
if v-dimm-parts:identifier
has been used) will be dimmed when the mouse is out of the dimm-part
element.
Modifiers:
inverted
to have inverted dimmers