Skip to content

parseOfdDocument 解析到的 ofd:Template 是个数组,造成 renderPage 方法报错 TypeError: Cannot read properties of undefined (reading 'json') #112

Open

Description

@Hughe5

使用 parseOfdDocument 方法解析 ofd 文件,success 返回的数据里 pages[0][47].json["ofd:Template"] 是个数组,不是对象,如下图,
image
当 template 是数组时,template['@_TemplateID']]['json'] 会报 TypeError: Cannot read properties of undefined (reading 'json') 的错误,如下图,
image

Activity

  1. Hughe5 commented on Jun 3, 2024

    @Hughe5
    Author

    @DLTech21
    image
    存在多个 Template 时会报错

  2. DLTech21 commented on Jun 3, 2024

    @DLTech21
    Owner

    自行修改

  3. Hughe5 commented on Jun 4, 2024

    @Hughe5
    Author

    @DLTech21 大佬,帮忙评审并合入一下 #113

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions