VV::embed()
-Inline the contents of any file.
-This can be very useful for bundling SVGs, plaintext files, HTML, and more for faster page loading.
+Navigation.EVENTS
+A set of CustomEvent
instances dispatched when various Vegvisir navigations are performed.
Parameters
+Properties
string
- $pathname
- Path to an asset to inline.
+STARTED
+ An event dispatched with the type
of "navstarted"
on the target
element when a navigation has started. This event is also dispatched on document.body
.
The detail
property of this event returns the Navigation
instance that initiated the navigation.
bool
- $relative
- Flag which when set to:
--
-
-
-
true
-Will make
-$pathname
look for a file relative toroot_path
.
- -
-
false
-Will make
-$pathname
look for a file relative to the root of the whole filesystem.
-
Return value
-string
- Returns the contents of a file passed to $pathname
as a string. If a file can not be found at $pathname
, an empty string is returned.
FINISHED
+ An event dispatched with the type
of "navfinished"
on the target
element when a navigation has finished loading completely (content has been injected). This event is also dispatched on document.body
.
The detail
property of this event returns the Navigation
instance that initiated the navigation.
Examples
Inlining an SVG icon
-In this example we will be inlining an SVG icon from /public/assets/icon.svg
directly into our page as if it were hardcoded.
No examples available.