LINK
Introduction
The LINK function allows a portion of a string to be converted into a hyperlink. It accepts two parameters, the first being the text to display and the second the URL to link to.
Usage
The LINK function accepts a string to display as the hyperlink and a URL to determine where the link goes. It will return the display text wrapped in <a></a>
HTML tags. You may pass the identifier of another resource (such as a string, term, or variable) as either parameter value.
Example
In this example, tos_message
calls the LINK function, passing the tos_name
string identifier and the url
variable.
tos_name: `Terms of Service`,
tos_message: `Visit our { LINK(tos_name, :url) }`
Next, we translate the string, passing in the url
variable's value at runtime.
$translate('tos_message', { url: 'foo.html' });
<div v-i18n="{ url: 'foo.html' }">tos_message</div>
Visit our <a href="foo.html">Terms of Service</a>
<div>Visit our <a href="foo.html">Terms of Service</a></div>
Last updated