【问题标题】:How pass parameter in pug?如何在 pug 中传递参数?
【发布时间】:2021-11-10 18:54:04
【问题描述】:

我有一个带有 URL 参数的简单模板,但它不起作用

doctype html
html
  head
    block head
      meta(charset="utf-8")
      meta(name="viewport", content="width=device-width")
      meta(http-equiv="X-UA-Compatible", content="IE=edge")
      meta(name="x-apple-disable-message-reformatting")
      link(rel="stylesheet", href="style.css", data-inline)
  body
    p Приветствую #{name},
    p  #{url} // it is work

    p 
      a(href='/' + #{url}) Google // it not working

我尝试了不同的变体

“哈巴狗”:“^3.0.0”

【问题讨论】:

  • 你到底想做什么?您是否尝试发送带有链接的电子邮件? url参数是如何传递的?

标签: javascript reactjs pug


【解决方案1】:

简单的答案是:

a(href=`${url}`) text any url

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2018-07-02
    • 1970-01-01
    • 2021-11-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-07-05
    • 2017-01-15
    相关资源
    最近更新 更多