文档模板器。嵌套对象

Joe*_*Joe 2 javascript docxtemplater

我正在使用https://github.com/open-xml-templated/docxtemplater

我的数据:

var person = {
  name: 'Joe',
  address: {
    city: 'Stockholm',
    postal: 45123
  }
}
Run Code Online (Sandbox Code Playgroud)

如何使用这个嵌套对象在 docx 中编写语法?

这是行不通的:

{address.city}
Run Code Online (Sandbox Code Playgroud)

在文档中找不到任何示例。

edi*_*999 6

默认情况下,您必须执行以下操作:{#address}{city}{/address}

如果您使用 angularParser,它将是 {address.city} : http: //docxtemplater.readthedocs.io/en/latest/configuration.html ?highlight=angular#custom-parser

请参阅https://github.com/open-xml-templated/docxtemplater/issues/243