Skip to content

Commit 2d452a8

Browse files
committed
更新variant文档,支持默认变体
1 parent 34b9e0b commit 2d452a8

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

docs/manual/variants.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,8 @@ return {
9393

9494
在为某个变量指定了当前使用的变体后,如果对应的字段不存在,则取默认字段的值。同样地,以变体en为例,如果`value@en`列不存在,则取`value`列的值,如果`value`列也不存在,则抛出字段找不到的错误。
9595

96+
可以使用`--variant default={variantName}`设置全局默认变体,当未没有为某个bean单独设置变体时,则取全局默认变体。
97+
9698
如果某个字段定义了变体,但没有在命令行中使用`--variant`指定该字段使用的变体名,则读取不含变量的原始变量的值。此时Luban会打印一行警告日志。
9799

98100

i18n/en/docusaurus-plugin-content-docs/current/manual/variants.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,4 +92,6 @@ Generally speaking, since a variable variant is defined, the variant that should
9292

9393
After specifying the currently used variant for a variable, if the corresponding field does not exist, the value of the default field is taken. Similarly, taking variant en as an example, if the `value@en` column does not exist, the value of the `value` column is taken. If the `value` column does not exist either, an error that the field cannot be found is thrown.
9494

95+
You can set a global default variant using --variant default={variantName}, and when a variant is not individually set for a bean, the global default variant will be used.
96+
9597
If a field has a variant defined, but the variant name used by the field is not specified using `--variant` in the command line, the value of the original variable without the variant is read. At this time, Luban will print a warning log.

0 commit comments

Comments
 (0)