Skip to content

:let套太多层,会造成一些类型是对象的变量丢失 #55

@lyt9304

Description

@lyt9304
::div.test (regularPosts, vipDingPosts)
    :let a = *[0], a2 = *[1]
        - echo $a->count();//输出5
        - echo $a2->count();//输出4
            :let b = 1
                - echo $a->count();//应该输出5,但是报错Undefined Variable a
                - echo $a2->count();//应该输出4,但是报错Undefined Variable a2

当mixin的参数是对象,并且嵌套2层以上:let就会造成变量丢失,但是普通的字符串或者数字不会丢失。

::div.test (regularPosts, vipDingPosts)
    :let a = *[0], a2 = *[1]
        - echo $a->count();//输出5
        - echo $a2->count();//输出4
            :let b = 1, a = a, a2 = a2
                - echo $a->count();//输出5
                - echo $a2->count();//输出4

要这样中继一下,才可以在下面读取到。

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions