我在
中有这个输入文本<input type="text" id="usernameId" name="username" placeholder="User" />
我想从属性文件中替换占位符 User for 1 text 的文本,但不知道是否可行
<input type="text" id="usernameId" name="username" placeholder="th:text="#{user.placeholder}"" />
最佳答案
有一个特定的 Thymeleaf 属性:
<input type="text" id="usernameId" name="username" th:placeholder="#{user.placeholder}" />
也可以这样写:
<input type="text" id="usernameId" name="username" th:attr="placeholder=#{user.placeholder}" />
关于html - 输入类型 ="text"中的 Thymeleaf 占位符,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43810612/