方法一:三目运算符

 <input type="text"  th:value="${userInfo!=null ?userInfo.phone:''}">
                                           

方法二:*{ xx },后台数据要设置为内置对象

 <input type="text" class="form-control" th:value="*{qq}">

建议方法一,简单粗暴

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-11-04
  • 2022-01-14
  • 2021-09-16
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-08-08
  • 2022-12-23
  • 2021-08-08
  • 2021-07-26
  • 2021-09-18
相关资源
相似解决方案