node.js - 如何在 Handlebar HBs 引擎中使用 If 条件
问题描述
我已经使用这种和平的代码并面临一个错误,正如我在下面提到的第 26 行解析错误:... {{#if (error !="")}} <
期待 'CLOSE_RAW_BLOCK'、'CLOSE'、'CLOSE_UNESCAPED'、'OPEN_SEXPR'、'CLOSE_SEXPR'、'ID'、'OPEN_BLOCK_PARAMS'、'STRING'、'NUMBER'、'BOOLEAN'、'UNDEFINED'、'NULL'、'数据','SEP',得到'无效'
如何解决这个问题?
我在 hbs 中使用的代码是
{{#if (error !="")}}
<div
class="alert alert-danger alert-dismissible fade show"
role="alert"
>
<strong> Error </strong>
{{error}}
<button
type="button"
class="btn-close"
data-bs-dismiss="alert"
aria-label="Close"
></button>
</div>
{{/if}}
解决方案
推荐阅读
- python - Python Exchangelib / 如何访问公用文件夹
- java - java中的XML-RPC结构
- c# - 如果目标不是 FrameworkElement,如何在代码隐藏中设置 DynamicResource?
- angular - 命名方法的正确方法
- performance - 哪个操作更快:filter 或 withColumn with when?
- c# - 如何从碰撞中检查对象名称?
- angular - Ngrx 实体,如何定义动作以及如何正确命名具有效果的动作
- azure - 如何在本地调试 EventHubTrigger?
- ios - 如何在 IOS cordva 应用程序中添加 cordova 插件?
- visual-studio - F#双击文件在VS中创建一个副本