【问题标题】:Incorrect pug/jade variable scope using jade4j使用jade4j的哈巴狗/玉变量范围不正确
【发布时间】:2017-06-27 07:14:20
【问题描述】:

我正在尝试以下翡翠模板。我的期望是在循环结束时 test 的值应该是 5

-test = 0
-var array = [1,2,3,4,5]

p before loop: #{test}
for element in array
  - test++
p after loop: #{test}

实际上正在小提琴中工作:http://jsfiddle.net/so5tqp35/ 那里的输出是:

before loop: 0
after loop: 5

在我的本地网络服务器中无法正常工作,而我有

before loop: 0
after loop: 0

没有出现任何错误。我正在使用 springboot 和这个插件来处理玉文件。

<dependency>
  <groupId>de.neuland-bfi</groupId>
  <artifactId>spring-jade4j</artifactId>
  <version>1.2.3</version>
</dependency>

因此,工作流程似乎有问题,变量没有被覆盖。我怎样才能找到一些关于哪里出了问题的提示?

【问题讨论】:

  • 错字?您的本地网络服务器输出与小提琴的输出相同。
  • ops... 绝对是一个错字。现已修复,fiddle / local 不同。
  • 为什么要使用未声明的变量?光是声明不就解决了问题吗?
  • 试过一个:- var test...但结果还是一样

标签: pug jade4j


【解决方案1】:

问题在于我使用的插件:de.neuland-bfi

已经有解决该问题的错误报告:https://github.com/neuland/jade4j/issues/153

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2018-05-13
    • 1970-01-01
    • 1970-01-01
    • 2016-09-02
    • 1970-01-01
    • 1970-01-01
    • 2018-07-31
    • 1970-01-01
    相关资源
    最近更新 更多