Skip to content

etpl 中是否支持全局变量 #77

@100pah

Description

@100pah

echarts-doc 中使用 etpl 进行编译。其中使用了诸多 use(doc 的各种公用部分用 etpl 的 target 来写,用 use 引用)。

因为 echarts-doc 中大多地方都需要使用 ${galleryViewPath} 这个变量(来指定外部链接路径),从而 ${galleryViewPath} 这个变量要在每次使用 use 时主动传入,例如:

{{use: partial-treemap-level-props(
    prefix="#",
    galleryViewPath=${galleryViewPath}
)}}

(源于这里

一层层的传递很容易忘写。忘写时编译也不会出错,从而不被发现。

所以是否能支持直接设置 ${galleryViewPath} 为全局变量?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions