link_to

生成 HTML<a>标签。

参数

  • str {String} 输入字符串,必填
  • url {String} 链接地址,必填
  • [attribute] {Object} <a> 标签支持的属性
  • returns {String} html 字符串

用法

{{ link_to str url [attribute] }}

例子

{{{ link_to 'Shopline' 'https://www.shopline.com' }}}

Output

HTML 属性

你可以通过包括一个与属性名称相匹配的参数,以及所需的值来指定HTML属性。

{{{ link_to 'Shopline' 'https://www.shopline.com' title='A link to Shopline' class='link-class' }}}

Output

这篇文章对你有帮助吗?

Error loading component.

Error loading component.