开发者

{name} is not replaced if they are in the attributes, how to handle?

The test开发者_JAVA技巧 code is:

val s = "#"
val x = <a href="{s}">{s}</a>
println(x)

It prints:

<a href="{s}">#</a>

Notice the {s} is still there in the attribute, how to fix it?


val s = "#"
val x = <a href={s}>{s}</a>
println(x)

Notice no quotes! Prints:

<a href="#">#</a>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜